My A Star 32U4 is coming together, so I thought I’d try it “stand alone”. There is a 5/12 VDC external supply for the logic and the steppers. All is working as I should - until I remove the USB cable with which the IDE uploads thru. I also have data exchanges in on Serial1 (just simple single-letter protocol) with a CP2104 USB-to-Serial board. Incoming data is seen on the RX pin - but nothing is going out.
Is there anything that needs to be done for the Serial1 to continue working without the USB cable?
You would need to specify the baud rate for
Serial1 before transmitting data. (See the
Serial.begin() page on the Arduino website if you haven’t already.) Which RX line are you talking about and how did you determine that the RX line getting data? Can you post pictures showing how you have everything connected and the code you are running?
Note - the board works totally fine when the USB is plugged in. I’m receiving joystick data from a Processing program. The data is coming from the TX/RX pins on the CP2104, and are connected “null-modem” style - TX to pin RX 0 on 32U4, and RX to pin TX 1 on the 32U4. Baud rates are 57600. When connected via the uploading USB cable, I can see the red and green data LED’s flashing as the data comes in - and the steppers move accordingly as driven by the 32U4. As I plug in the USB cable, I get a response from Windows, and a red LED on the 32U4 flashes briefly. When I start the Processing program sending data - I see a green flashing TX LED on the 32U4 which shows it is handshaking with the Processing program by way of the CP2104.
While receiving data, I unplug the USB to the 32U4 and the green TX LED goes on solid and no data is showing on RX. When I restore the USB - the green LED begins blinking again.
So my question is: What would cause the 32U4 to act differently with the USB cable in or out? The cable is supposed to ONLY for uploading data. This is my first experience with the 32U4 having only used Pro Mini’s and Nano’s before. Totally new issue!
The USB interface is not just for uploading sketches: it can also provide power and can be used for communicating with the sketch. You should make sure that you have connected an appropriate power source to the power input pins of your A-Star 32U4 so that it can run without USB power.
The behavior you’re describing sounds like you are sending data through the A-Star’s USB port and not through the CP2104 USB-to-Serial adapter. Please post your code and pictures of your connections.
Amanda - case closed - I discovered my error - just my stupidity! Everything is working fine now -Thanks for your efforts.