![]() |
Forum Index : Microcontroller and PC projects : PicoMite - Strange PIN behavior
Author | Message | ||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi, Happy New Year to you all. I am struggling to understand some strange PIN output on my PicoMite (ver 5.0701). I have cleared the Pico and loaded everything from scratch several times. I'm running the following code via MMEdit v5 and have pin GP6 connected to pin GP7. The connections are sound and not intermittent. I can make/break the pin GP6 to GP7 connection. I expect the print statement to show GP6 as '0' when it is broken and '1' when it is made. It intermittently: - fails to change from 0 to 1 and vice versa - works properly - starts with the wrong value even when started from a powerdown/up or re-load of the code. Is it me or something else? Cheers, Andrew 'PinTest.BAS SETPIN GP6, DIN SETPIN GP7, DOUT : PIN(GP7)=1 Do PRINT "GP6= ";PIN(GP6), " GP7= "; PIN(GP7) PAUSE 1000 LOOP |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
with the link between 6 and 7 broken, there would be a high impedance input on 6. That would be unstable. Jim VK7JH MMedit |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Thanks Jim. How then can I test if a pin is high or low? (I'm trying here to to get I2C comms to a Laser Distance sensor (for a water tank) to work. I think it relies on a pin being held high and I want to test that it is.) Cheers, Andrew |
||||
phil99![]() Guru ![]() Joined: 11/02/2018 Location: AustraliaPosts: 2642 |
Hi Andrew, Make your input pin analogue and put a 10k to Gnd and another 10k to 3.3V. You can then see if the output pin is high, low or off. |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Thanks Phil. Will do. Andrew |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |