Analog read reboots pyboard ?

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
synimak
Posts: 20
Joined: Sun Feb 28, 2016 5:11 am
Contact:

Analog read reboots pyboard ?

Post by synimak » Tue Sep 06, 2016 9:44 am

I have wired an 8 way rotary switch with resistors between each pin to create a multi load voltage divider. 3.3v on one side and GND on the other. One analog pin for 8 variations. Anyway... when analog reading; position 1 floats between 0-5 and position 8 stays at 4095. The switch is continuous so I can switch between position 1 and 8. When I switch between position 1 and 8 ie going from low to high or high to low the pyboard reboots.

Using pin X1

Any ideas why this is happening?

I've worked around the problem by putting another resistor between 3.3v and pin 1. Just through it was a weird phenomena.

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: Analog read reboots pyboard ?

Post by Roberthh » Tue Sep 06, 2016 10:24 am

I assume the switch shortened 3.3v and GND during the 1-8 transition, and adding the resistor solved that.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Analog read reboots pyboard ?

Post by dhylands » Tue Sep 06, 2016 3:24 pm

Mechanical switches come in two varieties (besides the throws and poles).

You can get a "make before break" switch or a "break before make" switch. It sounds like you have the former, which will briefly short the 2 positions when switching between them. If these happen to be 3.3v and ground, then this short, even though of a very small duration, will reboot your microprocessor.

The second kind of switch (break before make) won't short the inputs together, but will leave the output (of the switch) floating, not connected to anything during the switch.

synimak
Posts: 20
Joined: Sun Feb 28, 2016 5:11 am
Contact:

Re: Analog read reboots pyboard ?

Post by synimak » Wed Sep 07, 2016 8:17 am

Thanks guys. I know all that. Should have realised.

Cheers

Post Reply