Strange ocurences with an oscilloscope. Help please

Thread Starter

KansaiRobot

Joined Jan 15, 2010
324
Hello. I would like to ask help from you people that are more experienced in electronics.
I will present first the situation and then the problem. Even if you dont have experience with the micros or boards described in the situation please read the problem because I suspect that it is purely a electronics problem in general.

  • The symptoms
A pin changes values when I probe it with an oscilloscope and when I don't. Nothing else changes (the circuit, the program etc are the same)

  • The situation
(Read this just as a reference- I think the problem is more general)
I have a STM32 board (that works with 3.3V) and a CC3000 shield (Wifi shield) https://learn.sparkfun.com/tutorials/cc3000-hookup-guide?_ga=1.84372252.442459916.1462925819

I also have an Arduino Uno (works with 5V). When I connect the arduino to the shield (or the breakout) (and use its libraries) it works without problems
When I connect the STM32 nucleo to the shield, it does not work.

I have identified the problem to be in the INT (interrupt) pin of the shield.

  • The problem
I am using an oscilloscope to see the behavior of this pin. However a strange thing happens. There is a simple part of code that goes something like
Code:
pinvalue= pin.getValue();
printf("%d",pinvalue);
When there is no oscilloscope it prints "1". However when I probe the pin with the oscilloscope it prints "0".

Why this could be happening? A friend suggested that maybe there are some unstabilities in the shield, some open drain, and that I should put some pull up or pull down resistor somewhere. He mentions something about CMOS (stuff that I havent been able to learn well yet)

Any idea why this could be happening. Any help, advice , comment or pointer will be greatly appreciated

----------------
The rest of this post is just for reference. and it points at another strange thing that is happening.

  • More info
I suspect this is the key of the problem because my program stops at this point
Code:
while(spi_irq_state != 0)
        {
          spi_irq_state=_spi.wlan_irq_read();  
        printf("*");    //<-------GETS STUCKED HERE!!!
        }
        printf("\n OUT\n");
I thought that the INT pin never changed therefore being on an infinite loop, but neither the infinite loop or going out of the loop happens. The program just dies there.
So I am suspecting it is more of an electronics problem than a software one.
 

MrSoftware

Joined Oct 29, 2013
2,188
I'm taking a guess, but maybe that pin needs a pull-down resistor. Without the scope probe attached it's floating high, but the probe is enough to pull it down. What state are you expecting the pin to be in at that moment? Also are you explicitly setting that pin high or low in code?
 

Marley

Joined Apr 4, 2016
502
Sounds like the pin is open-circuit and floating. An input pin should always have a resistor pull-up or pull-down. Some micro-controllers have these internally and just need to be configured in code.
 

Marley

Joined Apr 4, 2016
502
Hi-z does mean high impedance. PU = pull up PD = pull down. Not sure what "Force 1" means but probably means pulled either up or down depending on the state.

All inputs (such as the SPI_CLK) should be not be left floating but definitely pulled to a defined logic level by the controlling micro-controller at all times. Any input not used or not changed should be permanently connected to GND or the supply.

Some outputs may be hi-z (open) especially when the device is reset or when /CS is high. This may not be a problem depending on what their use is.
 
Top