Dear Teensy community colleagues
Let me try to explain the issue I am facing at the moment in the most succinct way possible.
I am working on a project that will be powered by both USB (when debugging the system via serial port) and standalone using an external power source.
My project consists on the control of a pair of stepper motors via an analog joystick. It includes an I2C LCD display powered by the common +5V rail that feeds other active components (including the +5V rails from the stepper drivers).
I've followed all the recommendations from this forum regarding cutting the trace between VUSB and VIN and adding the two diodes (normal rectifiers in my case - for now-). The system works as expected (kinda...) if I power up the board using the external source, however here are some compromises after doing this:
1. If I use the USB cable attempting to debug the system, the I2C LCD won't turn on, for obvious reasons. The diode feeding the Teensy blocks the voltage that feeds the rest of the components, namely, the +5V rail. This means that basically only the Teensy is powering on when doing this BUT in addition to the LCD not turning on, the serial port won't receive any data under this condition. I must clarify that this is the ONLY case when I am capable of programming the Teensy without pressing the button.
2. When I plug in my power supply (leaving the USB plugged-in), then the serial port reports some expected info and everything seems to work "normally" (not quite true*. Bare with me...). Under this condition the I2C LCD shows ONLY black washed-off boxes but the system in general works "ok-ish", as I mentioned earlier.
3. If I ONLY power the system on through the external power supply, naturally the whole system works as expected without any problems but I don't have serial communication available for debugging purposes.
*The reason the system does not operate under normal conditions is that my particular application strongly depends on the ADCs: if I am under scenario No. 2 and I unplug the USB, the motors start randomly moving. My assumption is that the supply voltage changes thus affecting the analog references and the system "thinks" that I am moving the controller (Joystick).
Is there any way to have both USB and external power connected so that the I2C display responds normally and I am able to debug a normally operating system via serial port.
I believe that the reason why the I2C LCD is not turning on is for timing reasons. Clearly the MCU starts sending both SDA and SCL pulses before the LCD even turns on. I was thinking including a feature of powering on the whole system upon USB connection. A MOSFET that turns on when the USB cable is connected and switches the +5V rail at the same time. However my crappy solution will make the system entirely dependant on the USB connection. Nonetheless, a series of basic logic gates (OR) might do the trick...(perhaps)
Any help will be very much appreciated
Please do not hesitate to ask me any further questions in case my explanation was absolutely confusing
dzalf
P.S. I have the feeling that the solution might be trivial but I wanted to share my experience
P.S.2 Sorry for the typo on the title
Let me try to explain the issue I am facing at the moment in the most succinct way possible.
I am working on a project that will be powered by both USB (when debugging the system via serial port) and standalone using an external power source.
My project consists on the control of a pair of stepper motors via an analog joystick. It includes an I2C LCD display powered by the common +5V rail that feeds other active components (including the +5V rails from the stepper drivers).
I've followed all the recommendations from this forum regarding cutting the trace between VUSB and VIN and adding the two diodes (normal rectifiers in my case - for now-). The system works as expected (kinda...) if I power up the board using the external source, however here are some compromises after doing this:
1. If I use the USB cable attempting to debug the system, the I2C LCD won't turn on, for obvious reasons. The diode feeding the Teensy blocks the voltage that feeds the rest of the components, namely, the +5V rail. This means that basically only the Teensy is powering on when doing this BUT in addition to the LCD not turning on, the serial port won't receive any data under this condition. I must clarify that this is the ONLY case when I am capable of programming the Teensy without pressing the button.
2. When I plug in my power supply (leaving the USB plugged-in), then the serial port reports some expected info and everything seems to work "normally" (not quite true*. Bare with me...). Under this condition the I2C LCD shows ONLY black washed-off boxes but the system in general works "ok-ish", as I mentioned earlier.
3. If I ONLY power the system on through the external power supply, naturally the whole system works as expected without any problems but I don't have serial communication available for debugging purposes.
*The reason the system does not operate under normal conditions is that my particular application strongly depends on the ADCs: if I am under scenario No. 2 and I unplug the USB, the motors start randomly moving. My assumption is that the supply voltage changes thus affecting the analog references and the system "thinks" that I am moving the controller (Joystick).
Is there any way to have both USB and external power connected so that the I2C display responds normally and I am able to debug a normally operating system via serial port.
I believe that the reason why the I2C LCD is not turning on is for timing reasons. Clearly the MCU starts sending both SDA and SCL pulses before the LCD even turns on. I was thinking including a feature of powering on the whole system upon USB connection. A MOSFET that turns on when the USB cable is connected and switches the +5V rail at the same time. However my crappy solution will make the system entirely dependant on the USB connection. Nonetheless, a series of basic logic gates (OR) might do the trick...(perhaps)
Any help will be very much appreciated
Please do not hesitate to ask me any further questions in case my explanation was absolutely confusing
dzalf
P.S. I have the feeling that the solution might be trivial but I wanted to share my experience
P.S.2 Sorry for the typo on the title
Last edited: