> Why assign to WDT or else???
With the prescaler assigned to the WDT, there is none assigned to timer0, counts will increment on every pulse rather than the default timer0 prescaler of 1:2 which would require 2 pulses on RA4/T0CKI per count increment. The best resolution is with no prescaler.
> Here is one i want to try. Did you look to my dimmer code (the > last post, code is in attachement) ???
I haven't yet, but I can take a look at it later this evening - time permitting.
> How to work with MPLAB stop watch.. is it need any specific
> hardware to use it, i.e. MPLAB-ICD or something? i figure yes
> but not sure now.
Nothing special required. Just click Debugger >> StopWatch, and it will show the number of instruction cycles your code uses during simulation. Very easy.
> I was figuring also something else to monitor counter... using
> external TimeBase to start and stop a counter variable. once
> it's stop send serial, or look in MicroCode studio a specific
> counter variable.... for sure it will not be 100% accurate but will
> be close.. no???
If you're going to trade-off for external hardware, a very simple option would just be to use an LED display driver that didn't require refreshing. Something like the MC14489B. We use this IC in our 4-digit, 7-segment Serial LED Display shown here http://www.rentron.com/Products/SLED4C.htm
You can find the MC14489B at DigiKey, Jameco, and several other places for a few $ each. Very handy little IC. Especially when using a controller with limited peripherals & I/O.
> I agree it will not giving me the cycles but an amount of count
> of the time a procedure or a loop take. How does it sounds...
> don't be afraid to say me i'm totally out. I can take everything...
> i'm here to learn and help... when i can
That won't work because PBP library commands, depending on the command, can be several pages of assembly code. Within the MicroCode Studio ICD, you have no idea of how many lines this is, or how many cycles it takes to execute a PBP command.
The MPLAB StopWatch will show you precisely how many instruction cycles it takes to get from point A to B. MicroCode Studio ICD will not. Big difference.
As you suggested earlier, dropping in a PIC with timer1 would be a great option, but if this isn't do-able, the MC14489B may be an option. It would certainly simplify the process, but there are other ways to use what's on hand. Just have to get a little creative...;o]
Bookmarks