-
Command execution time
I really must stop posting ....
Is there any reference that shows how long each command takes to execute in PICBasic for a given clock speed?
I have a main loop that does nothing bit set pins and evaluate IF THEN statements while waiting for interrupts, so ideally they should all be serviced very quickly, but wheras in assembler its easy to find out (hard to write) in Basic it seems the reverse. Any thoughts?
Ben
-
for a 4MHZ clock, most command will be executed in *about* 4us but can be tested/measure easilly in a loop.
loop:
High OneUnusedPin
' code here
Low OneUnusedPin
goto loop
place a scope/frequency meter on OneUnusedPin and now you have a good idea of the execution time.
regards
-
Hi barkerben,
You can also time the instructions using Timer1.
For an example of how to... See this thread.
http://www.picbasic.co.uk/forum/show...=&threadid=365
HTH,
Darrel