Search found 53 matches

by v923z
Thu Jan 18, 2018 8:12 pm
Forum: MicroPython pyboard
Topic: counting external events
Replies: 2
Views: 563

Re: counting external events

Fantastic, many thanks, Dave! Indeed, one has to go to the bit level settings of the hardware. In any case, brilliant example, not only for the frequency counter, but also for the low-level manipulation of the hardware.
by v923z
Thu Jan 18, 2018 7:57 pm
Forum: MicroPython pyboard
Topic: counting external events
Replies: 2
Views: 563

counting external events

Hi all, On the pyboard, is it possible to set up any of the pins to count external events? I know that I can do that with interrupts, but what if the count rate is so high that interrupts are no longer a viable option? I would basically like to use the hardware counter, and the chip supports that, b...
by v923z
Thu Nov 16, 2017 7:40 am
Forum: MicroPython pyboard
Topic: is the 32-kHz crystal necessary?
Replies: 2
Views: 724

Re: is the 32-kHz crystal necessary?

The firmware will try to autodetect the presense of an external 32kHz crystal (LSE). If the LSE fails to start then the firmware will fallback to the LSI setting (internal osc). So, to answer your question, if you remove the crystal and use the pre-complied PYBv1.x firmware then it will (or at leas...
by v923z
Wed Nov 15, 2017 10:01 pm
Forum: MicroPython pyboard
Topic: is the 32-kHz crystal necessary?
Replies: 2
Views: 724

is the 32-kHz crystal necessary?

Hi all, If I don't care about the RTC, do I need the 32-kHz crystal on the pyboard? I have to make my own board, because the pyboard is just a tad large, and I would like to strip everything that is not required. On the pyboard lite this crystal is optional. Apart from the target, and as far as the ...
by v923z
Mon Nov 13, 2017 8:44 pm
Forum: General Discussion and Questions
Topic: enabling/disabling interrupts in assembly
Replies: 2
Views: 632

Re: enabling/disabling interrupts in assembly

Robert,

Thanks for the pointer!

Zoltán
by v923z
Mon Nov 13, 2017 7:44 pm
Forum: General Discussion and Questions
Topic: enabling/disabling interrupts in assembly
Replies: 2
Views: 632

enabling/disabling interrupts in assembly

Hi all, In a critical section of my code, I have to toggle a couple of pins in assembly, because speed/accuracy is essential. I have separated this part of the code in a single function (I don't care about the overhead of calling the function), and decorated it with @micropython.asm_thumb But this i...
by v923z
Fri Jul 14, 2017 8:27 am
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2822

Re: retrieving timer ID

As far as I know you're the first to want to retrieve timer ID. A feature request is up to you but it may not get a high priority given that Python workrounds exist. I think I had a pull request in mind. The implementation is probably not too hard, I just have to find the time. While it is true tha...
by v923z
Thu Jul 13, 2017 3:43 pm
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2822

Re: retrieving timer ID

I think the problem here is that the argument to the timer callback is defined in the firmware to be the timer instance. The only way to add context (so far as I know) is via a bound method. I tried subclassing the Timer in the hope that the callback would get the subclass instance but this didn't ...
by v923z
Mon Jul 10, 2017 8:39 am
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2822

Re: retrieving timer ID

I don't know the answer to your question, but a workround could be achieved by creating a class which stores the timer ID along with the timer itself: class MyTimer(): def __init__(self, id): self.id = id self.timer = pyb.Timer(id) def timer_callback(my_timer): timer = my_timer.timer timer.deinit()...
by v923z
Sat Jul 08, 2017 6:39 pm
Forum: General Discussion and Questions
Topic: retrieving timer ID
Replies: 12
Views: 2822

retrieving timer ID

Is there a way of finding out a timer's ID in its callback function? I need to initialise and deinitialise timers which are not tied to specific tasks. Basically, I have a bunch of methods that could require a single-shot timer, but not necessarily. Since I don't know in advance, whether a particula...