|
Forum Index : Microcontroller and PC projects : random brief delays in PicoMiteBT
| Author | Message | ||||
| crez Senior Member Joined: 24/10/2012 Location: AustraliaPosts: 155 |
Option nocheck on Timer =0 For h=1 To 50000 k=Timer k=Timer-k If k>.06 Then Print k,Timer Next h Option nocheck off End The above gives, on average, at least 1 result around 0.4 milliseconds per run. Are there any other options (apart from 'nocheck') I can use to minimise these brief interruptions? Some runs print no results, other runs can print 10. All results printed are around 0.4 to 0.6 milliseconds. running on RP2350 |
||||
| PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 2025 |
This is all I have in front of me atm, and I ran it several dozen times with no delays. |
||||
| crez Senior Member Joined: 24/10/2012 Location: AustraliaPosts: 155 |
Thanks for trying it. Maybe something to do with the bluetooth, an interrupt that can't be paused? I'm going to have a go at doing something with PIO. That way there can be no unexpected delays. |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 6001 |
Even if MMBasic seems single thread, thrre are background tasks. And these you see as 0.4ms delays. One obvious task is the console. You use a print statement. That can also scroll a screen, or in case USB or BT, needs cpu support. Volhout P.S. some mmbasic commands avoid this, ADC run, and streaming bits from an array. But PIO is an obvious way to go. MMBasic has good support for it Edited 2026-07-29 00:43 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |