before adding your code, set up a real time loop with interrupt every 100 milliseconds (that gives 10 times per second and allows for many microsecond instructions to run within main timing loop) don't use any pauses....just set/start/check counters in loop sections as each pass is exactly .1 seconds.
So program runs main loop including your individual code parts..... then waits at the bottom in a while command until the interrupt sends it back to main loop ......
as long as all your code operates within 100 milliseconds (that's many 1 and 2 microsecond machine code instructions) then the loop will always wait until retriggered after looping through your code in the while loop.
You set up a few flag type bits or bytes that get set/reset/checked for program flow.
sorry if explanation is messy.
First get the main .1 second loop working (blink/toggle an led as an indicator) then add in your code relying on the .1 second looping time.
http://www.picbasic.co.uk/forum/asse...1&d=1311957346
Thanks so much amgen, i want to give this a try, looks much simpler. i am trying to convert the flowchart you posted to code, i will let u know how it turns out.
i will see if my original trial will even compile at all :-), then i will make comparisms
i want to be able to write more efficient code. one nice tool that has helped me to compare execution times of various methods of coding is DARREL TAYLOR's instruction time calculation code...
Bookmarks