Jump to content
  • 0

Max32 & Wifishield, pins going high for no reason


intwarrior

Question

When I connect the Wi-Fi Shield to the Max32 board and print out the state of the pins on the Wi-Fi Shield Vs the I/O shield I get completely different reactions, even though they connect to the same exact slots except for A6-A11 which aren't being used on the Wi-Fi shield & are left unconnected.

With the I/O shield the pins are all low (as they should be, there is nothing in the code to make them go high.

With the Wi-Fi Shield, & the same code, there are 3 pins that light up for no reason (the ones associated w/ Btn2&4 & SW1 on the I/O board.

What could this be? I am just learning.

Thanks so much for the help!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

@intwarrior,

The natural state of pins should be a "high impedence" state, allowing any other piece of connected hardware to "drive" the pin.  Within an MCU, such a configuration may be as an "input" port.  However, if nothing is driving the line, there's no reason why it should read either one or zero. 

I can tell you sad stories from college regarding trying to read from a line that wasn't being driven, and then trying to make sense of what was there.  (I think I had the address wires of a memory chip connected to the data lines or some such.)  The result wasn't all zeros or all ones, but rather what I had last placed there--the unconnected lines were acting like a capacitor.  I had thought the lines were connected to a memory chip that was driving them and ... fried a couple memory chips due to miswiring them before the instructor figured out what was going on.  My point?  If nothing's driving the line, you might be receiving signals from ... I don't know, another world?  :P

At any rate, if you are concerned about lines being driven that shouldn't be driven, try asking the MCU to connect a pullup (or pull down) resistor to the line.  That'll take it out of the high impedence state, and force it one way or the other--as long as nothing else is forcing it.  For example, the pull up resistor will force the line to a one unless something else is actually pulling it low.  The pull down resistor will do the opposite: pull the line to zero unless something is actively trying to drive the line.  This is a safer option than configuring the line as either a high or low output, since it won't short the port if you are wrong.

Dan

Link to comment
Share on other sites

Haha, I can't wait for the day that I confidently understand all of that. I am still new to all this and in college right now! I haven't taken a circuits class yet. We are playing with these in my assembly language/programming class. I know I am on the right track though, this is all very interesting and fun!

Well that is weird. I setup the code to have all states on 0. And when I just have the I/O shield on there is no problem all the LEDs are low. When I put the WifiShield in between the Max32 & the I/O shield the LEDs light up despite all the switches being in the off state & the buttons not being pressed. The code makes it only high when the switches are on & the buttons are pressed and low when they're not, yet 3 of the LEDS are always high no matter what. Since they're all getting the same pins, why would it make a difference that it's sandwiched if nothing else is changing? Thanks again!!

Link to comment
Share on other sites

@intwarrior,

It may be time to get to know your voltmeter.  Take the shield off.  Stick the probe in the various pins, while holding the ground probe on a ground pin.  It becomes an exercise of twister with the fingers, but ... that's where you'll find the ground truth regarding what is really going on with your board.  And ... if that doesn't answer it, then take a pair of AA's and repeat with the LEDs on the shield.  I've now been doing this sort of thing for more years than I like to count, and I still find myself pulling out the voltmeter--especially with new boards until I am familiar with them.

Dan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...