Yup, you caught me.dhylands wrote:I
If the main thread call function A, and an interrupt comes along and interrupts it in the middle and also calls function A, then function A will be called in a reentrant manner. Whether it will work properly or not depends on the nature of the function.
Search found 89 matches
- Tue Dec 01, 2015 3:56 pm
- Forum: MicroPython pyboard
- Topic: Interrupt documentation
- Replies: 21
- Views: 16299
Re: Interrupt documentation
- Mon Nov 30, 2015 10:02 pm
- Forum: MicroPython pyboard
- Topic: Interrupt documentation
- Replies: 21
- Views: 16299
Re: Interrupt documentation
Overall this is a great write-up and pitched at exactly the right level. For beginners, it includes enough Google-able keywords to hook them into further resources. For the most part, as I was reading it, any comment that came to mind was addressed further on. I just have a couple of quick comments:...
- Fri Nov 20, 2015 11:09 pm
- Forum: MicroPython pyboard
- Topic: Interrupt documentation
- Replies: 21
- Views: 16299
Re: Interrupt documentation
I agree you can't turn it into a class in operating systems. I think an example where two pieces of a structure are expected to be self-consistent (an array and it's length, perhaps?) and talk about how an interrupt might catch you between updating the array and updating the length. Then explain fur...
- Fri Nov 20, 2015 5:47 am
- Forum: MicroPython pyboard
- Topic: Interrupt documentation
- Replies: 21
- Views: 16299
Re: Interrupt documentation
A very worthy project. Comments: Under "general topics" for beginners: awareness that variables in the main loop may change unexpectedly. could be expanded into an explanation/definition of what a critical section is, and why it is important to think through all the ways in which an interrupt might ...
- Tue Nov 17, 2015 8:48 pm
- Forum: MicroPython pyboard
- Topic: The "why's" of timer allocation
- Replies: 10
- Views: 9555
Re: The "why's" of timer allocation
Great! Sounds like there are a lot of options here that would not be huge coding efforts.
- Tue Nov 17, 2015 5:49 pm
- Forum: MicroPython pyboard
- Topic: The "why's" of timer allocation
- Replies: 10
- Views: 9555
The "why's" of timer allocation
Wondering why timers are allocated the way they are. In particular: 1) Is there any reason servos need a 32 bit timer, or need an up/down counter? At first glance, it would seem that 16 bit resolution would be sufficient to drive most hobby servos beyond their resolution capabilities, and down count...
- Tue Nov 03, 2015 4:05 pm
- Forum: General Discussion and Questions
- Topic: Control Commands
- Replies: 17
- Views: 14722
Re: Control Commands
Perhaps its worth repeating the definition? "Read-Eval-Print-Loop (REPL)" once, the first time you use it, is probably sufficient in this context. Being friendly and approachable to new users from the Fine Arts department is what made Arduino successful. (Al M. from Hobby Engineering once told me h...
- Sun Oct 25, 2015 8:51 pm
- Forum: General Discussion and Questions
- Topic: Atomic read of 32bit I/O reg in callback - solved
- Replies: 4
- Views: 3894
Re: Atomic read of 32bit I/O reg in callback - solved
Inline asm functions will automatically convert their arguments to an "appropriate" value. If you pass in a buffer/string/array then it'll convert that to the pointer to the start of that buffer. Good to know. And you can load the pointer to the TIM2 CNT register directly in asm. Yes, true. I was g...
- Sun Oct 25, 2015 5:04 am
- Forum: General Discussion and Questions
- Topic: Atomic read of 32bit I/O reg in callback - solved
- Replies: 4
- Views: 3894
Re: Atomic read of 32bit I/O reg in callback - solved
Except about 10 minutes after posting this I realized it should probably be:
not array('i',[0])
Oh well. It's lights-out here so I'll test the change later.
Code: Select all
buf = array('I',[0])
Oh well. It's lights-out here so I'll test the change later.
- Sun Oct 25, 2015 4:47 am
- Forum: General Discussion and Questions
- Topic: Atomic read of 32bit I/O reg in callback - solved
- Replies: 4
- Views: 3894
Atomic read of 32bit I/O reg in callback - solved
One of the first speed bumps I ran into with the PyBoard was the problem of reading a 32bit I/O register in a callback. Specifically, getting the counter value from a timer running in quadrature encoder mode. The read of the 32 bit counter must be done atomically, as the counter keeps running whethe...