Searching \ for '[PIC]: MPSIM timing versus reality' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'MPSIM timing versus reality'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: MPSIM timing versus reality'
2002\09\13@174130 by Bob Barr

flavicon
face
Has anyone else encountered any timing differences between the MPLAB
simulator and actual operation of PICs?

I'm using Timer 1 to time 9600-baud serial on a 16F877 running at 6
MHz. Once I got all of the transmit timing worked out, my bit-time
worked out to be 104.00 uS according to the stopwatch window.
(Although, sometimes it's 104.666 uS. I haven't found exactly where
that 1 extra instruction cycle is sneaking in from but I'm fairly sure
that's a different issue.)

When I switch over and run the code on my ICD, I find that the
bit-time is actually around 107 uS rather than the 104 that I would
expect.

I've checked my scope's timing against two different 10 MHz TCXOs and
it's right on. The PIC's clock frequency is also right on at 6 MHz.

I hate to resort to some sort of 'fudge-factor' without understanding
what's going on. Any ideas would be appreciated.


Thanks, Bob

--
http://www.piclist.com hint: To leave the PICList
spam_OUTpiclist-unsubscribe-requestTakeThisOuTspammitvma.mit.edu


2002\09\13@180133 by Scott Dattalo

face
flavicon
face
On Fri, 13 Sep 2002, Bob Barr wrote:

{Quote hidden}

You could try using TMR0 as a reference counter. Essentially capture TMR0
at what you think are the start and end times - take the difference and
you have another reference point. Save this difference in a register that
you can examine either with the simulator or ICD. Or you could run
gpsim. :)

Scott

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam@spam@mitvma.mit.edu


2002\09\13@213128 by Jason Harper

picon face
Bob wrote:
> Has anyone else encountered any timing differences between the MPLAB
> simulator and actual operation of PICs?

I can confirm that MPLAB SIM fails to accurately simulate Timer 0 if you
modify its value while running (to get an overflow period less than 256
cycles), you get a period 1 cycle shorter than on an actual PIC.
       Jason Harper

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2002\09\13@220336 by Bob Barr

flavicon
face
On Fri, 13 Sep 2002 21:27:26 -0400, Jason Harper wrote:

>I can confirm that MPLAB SIM fails to accurately simulate Timer 0 if you
>modify its value while running (to get an overflow period less than 256
>cycles), you get a period 1 cycle shorter than on an actual PIC.

Thanks for the info on Timer 0, Jason. That's a good thing to know
about (especially before running into it as an issue rather than
after).

My problem, though, is with Timer 1 and I'm never updating it while
it's running.
I thought I might be running into an interrupt latency issue but the
datasheet says that latency only occurs on external interrupts.


Thanks, Bob

--
http://www.piclist.com hint: To leave the PICList
.....piclist-unsubscribe-requestKILLspamspam.....mitvma.mit.edu


2002\09\14@054733 by Morgan Olsson

picon face
For clarity: What PIC family, and what MPSIM version(s) are you guys talking about?

/Morgan

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


2002\09\14@074821 by Bob Barr

flavicon
face
On Sat, 14 Sep 2002 11:46:40 +0100, Morgan Olsson
<EraseMEmorgans.rtspam_OUTspamTakeThisOuTTELIA.COM> wrote:

>For clarity: What PIC family, and what MPSIM version(s) are you guys talking about?
>

Original problem: A 16F877 (using Timer 1) on MPLAB version 5.70.


Regards, Bob

--
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


More... (looser matching)
- Last day of these posts
- In 2002 , 2003 only
- Today
- New search...