nonNoise / PyMCP2221A

MCP2221 & MCP2221A work in Python.
MIT License
36 stars 21 forks source link

DAC value set truncated to 4 bits #9

Closed adralien closed 3 years ago

adralien commented 4 years ago

Thanks for the great code.

I did notice the DAC value set is ANDed with 0x0f instead of 0x1F when transmitted. This limits the maximum value of the DAC to about half scale.

Chipsettings 2 register in the part has 5 bits for DAC value. Line 438 buf[4 + 1] = 0x80 | (0x0F & value) # Set DAC output value