AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Arduino mega 2560 pro mini pinout pdf3/28/2024 ![]() ![]() ![]() ![]() I feel like the solution must be staring me in the face but for a week of head scratching I just can't get close to understanding the problem! (If I understand your understanding of my understanding correctly. In summary I don't believe it's about the USB IC not resetting the Mega or the ethernet board. Needless to say I've rolled back changes (using file versioning) and pulled-apart and re-built the prototype on breadboard. ![]() Either wayĪ) the fault is not manifesting itself when plugged into a Nano V3 or the Uno R3ī) likewise if I use a different model ethernet shield (I have another one, Sainsmart) stacked onto the same Mega, using the same sketch, it works fineĬ) furthermore it did work with my Mega for a couple of weeks throughout which I made a lot of changes in the sketch. I'm guessing this means it's not resetting properly, or there could be another fault. The issue is that the ethernet board is not responding. I've tried delays starting at 50 up to I probably wasn't clear enough! The Arduino resets fine after an upload or when hitting the reset button. Also yes, I have been experimenting throughout with delays at the beginning of setup() to ensure the ethernet resets before attempting to use it. I also set the outputs low to enable W5100. Either way, I've done that now but the ethernet board still apparently won't reset properly. This wasn't required when I was working with the Nano. I hadn't explicitly set pins 10 and 53 as outputs. I haven't listed most of the things I've tried, or included the code of my sketch, so it's a very vague request at this stage, but if there is anything else someone can write here to shed some light on exactly what happens when a Mega is plugged into a W5100 as compared with an Uno, I would really be Thanks. The ethernet board also works fine with my Uno - web server sketch runs fine. So I'm coming hat in hand to ask if someone can help me through by explaining exactly why the Mega was known to have reset issues with the first revisions of the ethernet shield, so I can at least have an understanding of how the resets work. I've read this forum a tonne and reviewed every old post relating to W5100 and issues with reset routine on the Mega, and tested lots of theories. When I plug the red board back into my old prototype stripboard on the Nano, it works like a dream. I have tried to figure out exactly what caused it to work when it did, but it's seemingly random. I literally can't get the thing to ping from a remote machine, let alone get MQTT working. I've gone to the following lengths: replaced ethernet cable, pulled apart my prototype and started from scratch, stripped the sketch back to its minimum code just for Ethernet and MQTT, tested with Arduino sketch for web server (can't get even this to work), and experimented with delays in the setup routine and even manually resetting the ethernet board by wiring it up to a tie-high resistor and switch and setting up the sketch to wait for me to reset then initialise ethernet library. The problem seems to be related to the reset process, but it's intermittent and therefore hard to pin down. In short, randomly after some change I made it stopped - and I've thrown literally HOURS of testing at the problem but haven't gotten to the bottom of it. No overheating, no random crashing, and apparently full reliability. Using this procedure my sketch worked beautifully for a week. After some googling I removed the reset line from ethernet board to Arduino during upload, replaced it after upload finished, then hit the physical reset button on the Arduino. I started having problems uploading the sketch. When I ported over to the Mega 2560, it worked when I used the correct pins: Mega 50-52 for SPI and Mega 10 for chip select. It seems safe to say there are no electrical issues with the red ethernet board for this reason. The red ethernet board and Nano V3 still work a treat. (See attached image.) Previously I used this board with my MQTT project using the standard ethernet library and the knolleary Arduino Client for MQTT on a Nano V3. I'm using the W5100 "red" breakout board purchased on eBay with a Mega 2560. With a view to the above, please be kind and help me to explain it better if I didn't manage! I'll try to explain my problem properly, but I've been struggling so hard with it over the last week and I know I haven't actually fully understood the problem, let alone managed to work out how to start solving it. ![]()
0 Comments
Read More
Leave a Reply. |