Search found 9 matches

by dwculp
Wed Aug 17, 2016 12:44 am
Forum: General Discussion and Questions
Topic: Interrupt vector numbers
Replies: 3
Views: 2193

Interrupt vector numbers

I think I might have answered my own question via experimentation but I wanted to ask just to make sure. I am building robots with the MicroPython board and wrote a quadrature encoder class. It is initialized as follows: def __init__(self, pinA, pinB, pullups=True): #configure the two pins and set t...
by dwculp
Tue Jul 26, 2016 8:06 pm
Forum: MicroPython pyboard
Topic: Serial output and ISR
Replies: 5
Views: 2497

Re: Serial output and ISR

I changed the ISR to the below code and it seems to work perfectly: #======================================================================= # Callback for our leaf switch #======================================================================= #Some global variables for our callback leafCounter = 0...
by dwculp
Tue Jul 26, 2016 5:01 am
Forum: MicroPython pyboard
Topic: Serial output and ISR
Replies: 5
Views: 2497

Re: Serial output and ISR

I am running the following:

MicroPython v1.8.2-11-gbe313ea on 2016-07-13; PYBv1.1 with STM32F405RG

Getting rid of the call to delay fixes the problem. I will implement a routine to debounce the switch without using a delay.
by dwculp
Tue Jul 26, 2016 12:19 am
Forum: MicroPython pyboard
Topic: Serial output and ISR
Replies: 5
Views: 2497

Re: Serial output and ISR

Im not doing the serial writes inside an ISR, they take place inside of a while loop in main.py. I have experimented with timeout values all the way up to 1000ms and I always get the error. Here is the complete serial LCD class in its current rough state: '''This is a simple class for interfacing an...
by dwculp
Mon Jul 25, 2016 3:47 am
Forum: MicroPython pyboard
Topic: Serial output and ISR
Replies: 5
Views: 2497

Serial output and ISR

I am writing an interface/driver for an Adafruit serial LCD. It is a simple device that requires only one serial wire to operate. It accepts simple byte sized commands to control the LCD. I have it working, it works great. However, in my test setup I also have an ISR that reads a switch. The only th...
by dwculp
Thu Jul 14, 2016 9:10 pm
Forum: MicroPython pyboard
Topic: Timer channel names
Replies: 1
Views: 1265

Timer channel names

I setup a few test circuits to test out my Pyboard. One had a simple photo-resistor hooked to one of the ADC lines (X8). I then read the ADC and converted it to a 0-100 value and fed it into the duty cycle of a PWM channel. I used pin Y12 which according to the diagram is timer 1 channel "CH3N ". It...
by dwculp
Thu Jul 14, 2016 5:08 pm
Forum: MicroPython pyboard
Topic: detect interrupt type in ISR?
Replies: 4
Views: 2033

Re: detect interrupt type in ISR?

Yep, I properly debounced it.

I have to say, this is one of the cooler little devices I have played with. I plan to turn it into a general purpose robotics controller for small mobile robots and let my students experiment with them.
by dwculp
Thu Jul 14, 2016 1:02 am
Forum: MicroPython pyboard
Topic: detect interrupt type in ISR?
Replies: 4
Views: 2033

Re: detect interrupt type in ISR?

Thanks for the reply! I was actually looking at the value of the pin inside the ISR but it was not working as expected. Essentially I wanted to set up a simple ISR that turned an LED on if the switch was down, and turn it off upon releasing the switch. It was not working as expected. I finally figur...
by dwculp
Wed Jul 13, 2016 6:48 pm
Forum: MicroPython pyboard
Topic: detect interrupt type in ISR?
Replies: 4
Views: 2033

detect interrupt type in ISR?

I just got my Pyboard and have been putting it through some tests. I need to know the following: 1. Is it possible to tell the interrupt type (rising or falling) inside of an ISR that is set to trigger on both a rising and falling signal? 2. Or, is it possible to set up multiple callbacks for the sa...