fijam / gmdrec

gmdrec is a USB interface between your late 90's Sony portable MiniDisc recorder and your PC.
https://www.tindie.com/products/fijam/gmdrec/
BSD 3-Clause "New" or "Revised" License
28 stars 6 forks source link

Refactor hardware initialization #17

Closed fijam closed 2 years ago

fijam commented 2 years ago

gmdrec currently supports two hardware options:

also to consider:

gooey complicates things slightly, as the python script needs to evaluate so that we can display the UI, even when nothing is connected yet. Then the user can connect either of the two revisions, or just half of the second revision (the adafruit breakout). Only the second revision carries eeprom. Third revision uses eeprom on the digipot chip (10 addresses available - just enough). As soon as the device is connected, the digipot needs to be put in shutdown to avoid #4. This is currently handled although in a bit of a convoluted manner, as it is intermingled with settings.py as well.

MCP4562 is put in shutdown differently, writing to TCON register (04h) disconnects the wiper or the B terminal from the resistor network, but it doesn't automatically re-enable it on writing a new wiper value.

Figure out how to refactor hw initialization to make it more simple and modular.

fijam commented 2 years ago

also integrate/rewrite adafruit_24LC04 into hardware.py

retarget for v0.7

fijam commented 2 years ago

mostly done really

fijam commented 2 years ago

OK, so I am not very smart and the i2c address of the new mcp digipot ended up being the same as the old AD one. It wasn't meant to be so. The hw initialization will need to be reworked (again).

fijam commented 2 years ago

re-implemented based on the return value of the status register (05h) on mcp4562 (rev3) https://github.com/fijam/gmdrec/commit/b28a4c007aa06e2c198a870288bff92e981b666a