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




Bookmarks