Saturday, January 02, 2016

Left floating?

In theory, things will work on the first try. In reality, theory is a nice concept. ;-)

One hard learned lesson, a lesson learned a long time ago, was the need to sometimes have pull-up, pull down resistors or both for some circuits. When things are left floating they may work in one place and fail completely in another or work for a time and later fail. I learned this when working on my first microprocessor design. The board sometimes worked when left alone but always worked after I grabbed the board to inspect it. It usually continued to work after the inspection. Seems that some habits like grabbing a board a certain way, done consistently would be enough to get the floating circuits into the correct state to allow it to work. These kinds of problems are tough to figure out. To make matters worse is when you are working with a 3rd party board and it has these kinds of problems. My MQTT code works well on the W550io boards but only sometimes works on the W5200 shield. Yes, there are code differences but I'm pretty sure I've eliminated that as the source of my problem (voodoo software, bad juju). A quick search of the internet didn't show any useful clues. Poking around in the libraries wasn't useful either (man the Arduino IDE hides way too much). After much trial and error I noticed 2 things. First if I wanted to use the W5200 shield I needed to have the SD card in, even though I'm not using it. And the second thing I noticed was that the w5200 worked perfectly when I added my bus pirate to the SPI circuit. This usually is a pretty good indicator that the pins need some kind of pull-down or more likely, pull up resistor. I'm pretty sure I'll need to set the appropriate port settings to add that or if worse comes to worse, add some resistors to my test boards.

I originally wrote this on 12/23/15 and it has been 11 days since I attached the bus pirate and the circuit has been stable. The software, not so much. I think it has a memory leak. I'll work on that.


Post a Comment

<< Home