I finally got a board designed, made and assembled with the Holtek chip, as well as a pair of 74LVC1T45s as discussed. It seems to work well, but there is one annoying problem: I cannot program my microcontroller while the USB is attached!
It's not the end of the world, but it's mightily inconvenient to have to un-plug and re-plug the USB cable every time I want to program the MCU.
I think I might know what the issue is, but I thought I'd check back here to see if others agree.
The microcontroller I'm using is an ATmega32M1, and the UART TX and RX pins on that are unfortunately shared with the MOSI and SCK pins for serial programming. Previously, on other projects that I've used the ATmegaXXM1 series on, when using an external UART-USB adapter, it's not been an issue, as all it meant was that a bunch of garbage got spewed across the serial terminal every time the microcontroller was programmed.
However, now with the Holtek USB interface, I think that things are not working for the following reason:
- The Holtek chip has an internal pull-up on its TX pin.
- The 74LVC1T45 transceiver on that line, as there is continuous power on both VCCA and VCCB, carries on replicating the signal from B to A.
- The A output is connected to the MCU's RX/SCK pin, and is actively being driven high.
- Because of this, during programming, my AVR-ISP MkII cannot apply a proper clock signal, so programming fails.
Is that likely to be the problem?
Any ideas on what can I do to resolve this? I have one idea myself, but it will involve tweaking the design and probably not do-able by bodging the current board.
I am currently running both 74LVC1T45s with the DIR pin grounded, so that signal goes from B to A. I could change the one that's on the SCK/RX pin to the opposite polarity (A to B) and connect its DIR pin to the MCU's reset line (where I have a discrete pull-up resistor), so it is normally pulled high. Then, during programming, while the reset line is pulled low for the duration of operations, the polarity of the 74LVC1T45 will be reversed (now B to A) and the SCK signal will be fed to the Holtek's TX pin, hopefully without issue.
Or am I over-thinking this and I just need to do something simple like add a series resistor to the MCU-side RX/SCK and TX/MOSI lines?