mrjimenez / JTAG

JTAG library for Arduino
BSD 2-Clause "Simplified" License
124 stars 22 forks source link

VREF does not work when INPUT_PULLUP is used? #13

Open ole00 opened 6 months ago

ole00 commented 6 months ago

I think the vref detection can't work properly on its own if the INPUT_PULLUP is used on the vref pin. When the JTAG cable is disconnected then the internal pull-up on the VREF pin will cause the vref detection to always read logical one - JTAG cable connected. I don't think there is a good solution for this, unless an external pull down resistor (about 2k) is used as well. Changing the INPUT_PULLUP to INPUT (without pull-up) helps a bit, but because the VREF pin is then left floating it might also trigger wrong vref detection depending on the electrical noise on the vref wire. Perhaps the best would be to add an option to ignore vref completely if a value of 0 (or -1) is specified as VREF pin when the player is constructed.

mrjimenez commented 6 months ago

Indeed, I don't think there is a good solution without extra hardware.