apfelaudio / eurorack-pmod

A eurorack-friendly audio frontend compatible with many FPGA boards, based on the AK4619VN audio CODEC.
https://apfelaudio.com/modules/available/pmod/
Other
167 stars 8 forks source link

hardware/r3.3: touch IC stuck in reset if jack 2 inserted before power up #59

Open schnommus opened 1 month ago

schnommus commented 1 month ago

I noticed recently during some testing that if I power cycle the whole modular system with an FPGA design saved in flash, if jack input 2 (starting at 0) is inserted before power up, eurorack-pmod does not start correctly because the touch IC rejects all I2C requests. Removing jack 2 instantly allows it to boot.

Interestingly, a software reset with jack 2 inserted after successful boot seems to work fine, so it's only a power on reset that seems to be affected by this. The root cause of this is probably that the CS2 is shared with AXRES unlike all the other touch pads, which per the datasheet means that the shield of jack 2 should NOT be permitted to be grounded during boot.

2 actions: 1) for the next revision (R3.4), revise jack 2 so the touch pad is never grounded during bootup 2) for the current revision, modify gateware to not perform touch IC initialisation until jack 2 is removed and add a note to the readme about this behaviour.

This way, everything still works fine even if jack 2 is inserted after a cold boot, just the touch sensing will not work until jack 2 is replugged.

schnommus commented 3 weeks ago

After #60 this will never halt initialization and instead only the touch scanning itself. The behaviour now is described in detail in the code comments, repeated here:

// Mitigation for `issues/59`: if CS2 of touch sense IC is shorted to ground
// (jack 2 is connected) during a cold powerup, it will just NACK all transactions.
//
// So, instead of halting initialization completely, we time out on touch IC
// initialization. This has the effect that if jack 2 is connected on a cold powerup,
// the touch sensing will not work until jack 2 is re-plugged, but everything
// else (CODEC/LED/Jackdet) will come up fine. Touch sensing will be instantly
// restored after re-plugging jack 2, no power cycle or reset is required as the last
// config written to the touch IC is fine as long as the eurorack-pmod has been
// used at least once (EEPROM in touch IC written).
//
// All of this is only relevant when the +3V3 supply goes down (cold power up). Usually
// if you're just re-flashing the FPGA (common use case), you won't hit this.