Hi,
I have recently obtained the pyboard v1.0 and the default system frequency is set to 168 MHz (I have also set the freq. to 120 MHz in boot.py). However, when testing the frequency by setting an LED on and off repeatedly, I only read approx. 33 kHz.
Is there something I have missed or am over-looking? I am trying to test how fast python files can run on this board.
Cheers
Nathan
Clock frequency
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Clock frequency
Python is an interpreted language and therefore runs much slower than the processor clock. However you should see rates nearer 100KHz: see this reference which also shows techniques for speeding it up further https://www.kickstarter.com/projects/21 ... sts/664832
You can speed it up to a stupendous degree by using the inline assembler, but this requires some knowledge of the ARM architecture and of assembly language programming. http://docs.micropython.org/en/latest/t ... mbler.html. Read the Wiki also if you want to use this technique as the assembler is not yet officially fully documented.
You can speed it up to a stupendous degree by using the inline assembler, but this requires some knowledge of the ARM architecture and of assembly language programming. http://docs.micropython.org/en/latest/t ... mbler.html. Read the Wiki also if you want to use this technique as the assembler is not yet officially fully documented.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Clock frequency
The high clock speed allows the peripherals to run fast as well. Eg you can get close to 1MHz ADC conversion into a buffer using ADC.read_timed. You can also use the timers to get high speed changes on pins.