Searching \ for '[PIC]:Problem with TMR0 and ICD stepping' 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/devprogs.htm?key=icd
Search entire site for: 'Problem with TMR0 and ICD stepping'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]:Problem with TMR0 and ICD stepping'
2001\05\12@122318 by Quentin

flavicon
face
Searched the archives and saw somebody had a similar problem but was not
helped.

When I step through my progam with ICD , TMR0 shows all kinds of values
and seems to have no sequence in it.
I use internal clock and 1:256 prescaler, 20Mhz on a 16F876.
At first I thought it was because of the debugging program that runs
during and after each step adding a few counts on (still a posibility),
but with a prescaler that high, surely I must see a sequence.
I also preload TMR0 with a value at overflow (using interupt). Everytime
I load the value, TMR0 shows a different value everytime.
Removing the prescaler has no affect on stepping, how ever I see a
difference on my project when I run it.
I run the same program through the simulator, and TMR0 works fine.

Is this a know problem?
Guess I have to do my debugging with this the hard way.

Quentin

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


2001\05\13@090621 by Olin Lathrop

face picon face
> When I step through my progam with ICD , TMR0 shows all kinds of values
> and seems to have no sequence in it.
> I use internal clock and 1:256 prescaler, 20Mhz on a 16F876.
> At first I thought it was because of the debugging program that runs
> during and after each step adding a few counts on (still a posibility),
> but with a prescaler that high, surely I must see a sequence.
> I also preload TMR0 with a value at overflow (using interupt). Everytime
> I load the value, TMR0 shows a different value everytime.
> Removing the prescaler has no affect on stepping, how ever I see a
> difference on my project when I run it.
> I run the same program through the simulator, and TMR0 works fine.

I don't use the ICD, so I'm only guessing.  Since you are single stepping,
the PIC is presumably spending most of its time waiting for the next
command.  That would certainly be a "long" time with many timer 0 wrap
arounds occurring.  It would make sense that the timer 0 value is
essentially randomized by the ICD between steps.  Again, I'm guessing, but
this may be a limitation of the ICD.  You can get a lot of debugging done
using the simulator with a little cleverness.  The other alternative is the
ICE which doesn't mess up timer 0.


********************************************************************
Olin Lathrop, embedded systems consultant in Littleton Massachusetts
(978) 742-9014, spam_OUTolinTakeThisOuTspamembedinc.com, http://www.embedinc.com

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics


2001\05\15@053415 by Wollenberg, Frank

flavicon
face
Hi Quentin,

> When I step through my progam with ICD , TMR0 shows all kinds
> of values
> and seems to have no sequence in it.

i havn't used the ICD yet, but AFAIK the ICD has special code in the last
100 hex words of ROM, which is executed after matching the breakpoint
address. Since this ICD code is normal code, TMR0 is updated continuesly.
You have to use a full emulator (ICE2000, ICEPIC,...) to measure TMR0 in
real time.
The ICD is not the right debugging tool for your problem.

Best regards,
Frank

GSP Sprachtechnologie GmbH
Frank Wollenberg
HW-Entwicklung
Tel.:   +49 (0)30 769929-78
Fax:    +49 (0)30 769929-12
eMail:  .....f.wollenbergKILLspamspam@spam@gsp-berlin.de



--
GSP Sprachtechnologie GmbH
Teltowkanalstr.1, D-12247 Berlin
Tel.:  +49 (0)30 769929-0
Fax:   +49 (0)30 769929-12
eMail: InfospamKILLspamgsp-berlin.de
Web:   http://www.gsp-berlin.de

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body


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