This is a very perplexing problem - hope somebody will have an idea.
This is a mature project that was working. It has an A-Star 32U4 board, a CP2104 usb-serial input and some stepper driver board to run 4 steppers. It is intended to run ‘standalone’ as part of a museum display.
All voltages and connections on the board have been check - and the board has run stand-alone in the past. Recently after connecting a PC and uploading a new version of the sketch - it will no longer run when the USB connection is removed from the 32U4. When connected - it works 100% as programmed. As soon as it is disconnected from the USB port it stops.
The CP2104 also has a micro USB connector and it’s outer metal shell shows continuity to ground. The outer metal shell on the USB connector of the 32U4 does NOT connect to board ground. Should it?
In standalone - the board is powered from a Meanwell dual voltage power supply - 5V & 12V for the steppers.
Please note as you review this: The board works 100% correctly when plugged into a USB tied to a PC. This would seem to indicate the board has no major wiring errors. Baud rates are all correct (57600). When operating, serial data coming and going from the 32U4’s serial pins at 0&1.
Is there any special setups needed to the 32U4 board itself that could cause such an odd situation?
Regards = Alan R.
It sounds like the issue might be power related or something in your latest code that’s preventing the program from running properly when there is no USB connection. We want to check for a power issue first. What is the current rating and limit of your power supply powering the A-Star? Can you measure the voltage and see if you are getting the expected voltage to the A-Star from the power supply? Could you also measure the voltage of the 5V line on the A-Star both when USB is connected and disconnected? Which A-Star 32U4 are you using?
It is normal to not measure ground on the outside of the USB connector on our A-Stars.
The (green board) 32u4 is running from either a bench power supply or a Meanwell RD50 dual voltage supply. Voltage has been check with DVM and is in spec.
I have brought the32u4 board back to the home lab - when powered only from a bench supply it does not run. As soon as I plug the USB into the PC it comes to life and is running fine.
I’ve been scouring the 'net on this issue and haven’t found any real discussion… it appears to be an issue with the 32u4 chip - which i went thru a while back, and THOUGHT I’d figured it out. But the prob is back again.
I can plug the 32u4 board (nothing else) into the USB connector - and I see it is running (the TX port blinks as data is going out). As soon as I remove the USB and switch to the bench supply the chip goes dark. The bench 5v supply is tied to the pin marked "5V’ and ground is tied to the pin marked “GND”.
I have also commented out the “while(!Serial);” statement and that makes no difference - it is still not running ‘standalone’. This has to be an oddity of the 32U4 - but I’m at a loss as how to proceed. Nothing is wrong and nothing is right!!
We have several A-Star 32U4 controllers on a green PCB. You can see all of our A-Star 32U4 programmable controllers here. Which one of our A-Star’s are you using?
You should not connect your A-Star to USB while supplying 5V to the 5V pin, since it will bypass the power selection circuit, shorting the two power sources together, and might damage something. Can you post close-up pictures of the top view of your A-Star board?
Have discovered, once again (big red face) it was the blanky-blank “while(!Serial)” that was getting me. ARRGH!