Hi Dick,
You're very welcome.Thanks for your response and your astute trouble-shoot of the problem. The suggested fix does work.
I had a suspicion that code execution time was the culprit, but had no way of checking for the overhead time. I am surprised that it adds to so much error. I gotta get some tools to do that kind of debugging.
Not at all. MPLAB works with most C compilers, PBP & PBC. It's a de-bugging/learning tool for the PIC. It's also free. My favorite price..;o]Isn't MPLAB an assembly language code development suite?
I highly recommend anyone using the PIC get familiar with MPLAB. It can save you countless hours of head-banging.
FYI: PBP uses a library. Even simple BASIC commands like serin, pulsout, count, while/wend, for next, etc, will generate many lines of code in assembly language. Some will generate "pages" of asembly code depending on the complexity of the command/library routine.
With MPLAB you can see all of this, and get a better idea of the over-head & time it takes for certain BASIC library routines (BASIC commands) to execute.
Here's how to install & set MPLAB up with PBP:
http://www.microengineeringlabs.com/support/mplab.htm
TIP: Get familiar with setting breakpoints & using the stopwatch to see how long PBP commands take to execute. Very handy stuff, and definitely worth the effort.
This particular problem/scenario is a prime example of why it's handy to learn to use MPLAB.
Bookmarks