I am in need of a processor way faster than Arduino. I also hate the arcane C language. Python looks much more intuitive.
Can someone please do the following test with their oscope hooked to their MicroPython or Teensy board?
Just write a short code to turn on a digital output and with no delay turn it off.
Measure the resulting pulse width.
With an Arduino Nano the fastest it can do, using C, is 4 microseconds.
Thank you.
Dean
How fast can the MicroPython switch a pin?
Re: How fast can the MicroPython switch a pin?
You probably want to read this thread: http://forum.micropython.org/viewtopic.php?f=2&t=1349
Re: How fast can the MicroPython switch a pin?
Thanks for pointing out that thread from February, Dave. I know nothing about Python but it seems as though getting a 100 ns pulse is possible with some software tricks on a board running at 168 Mhz. What is Viper?
I just don't want to buy a board and find it won't do what I need it to. Which board would you recomend; MicroPython or Teensy 3 point something?
I just don't want to buy a board and find it won't do what I need it to. Which board would you recomend; MicroPython or Teensy 3 point something?
Re: How fast can the MicroPython switch a pin?
MicroPython is definitely more mature. The Teensy only runs a small bit faster then MicroPython.
Viper is a sort of optimized code generator. It only works with some python, but it allows it to get compiled into something much faster than bytecode.
Personally, if I was looking for very precise pin toggling performance, I would write the low level code in C or assembler and call it from Python. If you choose assembler, then its possible to do it directly from MicroPython.
Here's an example I did where I needed a register write to happen within 10's of microseconds of a character leaving the serial buffer:
https://github.com/dhylands/bioloid3/bl ... ort.py#L60
Viper is a sort of optimized code generator. It only works with some python, but it allows it to get compiled into something much faster than bytecode.
Personally, if I was looking for very precise pin toggling performance, I would write the low level code in C or assembler and call it from Python. If you choose assembler, then its possible to do it directly from MicroPython.
Here's an example I did where I needed a register write to happen within 10's of microseconds of a character leaving the serial buffer:
https://github.com/dhylands/bioloid3/bl ... ort.py#L60