Exact match. Not showing close matches.
PICList
Thread
'[PIC]:weird jump of program to other program memor'
2003\10\27@140844
by
llile
|
There are a dozen possible causes. It is useful to list some of the ones
that have caught me:
1. Defining two variables to the same memory location, then wondering why
one of them changes seemingly randomly
2. Partial Resets due to noise on the MCLR line not completely resetting
the PIC and leaving it in an unknown state
3. EMI noise from an adjacent relay changes PIC registers
4. Unexpected WDT reset due to not putting WDT reset statements in
proper places
5. Timer interrupts not behaving as I thought they would due to
thumb-fingered programming of TIMERH and TIMERL registers
6. In assembler, messy stack issues when an interrupt trashes a key
register like w (C compilers are supposed to deal with this
auto-magically)
7. Leaving undefined states in any area of the program. For example:
char i;
i= 10;
do{
some stuff
}while(i--);
is perfectly acceptable in C Programming 101 but does not define behaviour
if noise or programming pencilheadedness enters the loop with I = 254.
char i;
i= 9;
do{
some stuff
}while(--i < 9 );
will define behavior for every possible value of i.
8. Ground bounce due to motors, inductive loads, or other heavy loads on
same ground bus as PIC, inadequate grounding and PCB layout
9. Fried PIC pins. The plucky PIC will still run after a bus fight has
destroyed two or three I/O pins, as long as they aren't shorted.
And the top 10 reason for this behaviour is:
10. Dumb programming mistakes. Pick apart your program pretending that
your worst enemy wrote it and you have to prove he is an idiot to win a
million bucks. You will find the problem very quickly.
I have done all of these and spent a half a day each on them until I went
"D'OH" and figured them out.
Tell us a little more detail and we can help you more specifically.
-- Lawrence Lile
paul sayuj <spam_OUTpaul_sayujTakeThisOuT
YAHOO.CO.IN>
Sent by: pic microcontroller discussion list <.....PICLISTKILLspam
@spam@MITVMA.MIT.EDU>
10/25/2003 02:10 AM
Please respond to pic microcontroller discussion list
To: PICLIST
KILLspamMITVMA.MIT.EDU
cc:
Subject: PIC:weird jump of program to other program memory location
hi,
I am facing a frustrating problem.
My program is jumping to other program location not
according to the flow of program.what may be the cause
of it?
paul sayuj
________________________________________________________________________
Yahoo! India Matrimony: Find your partner online.
Go to http://yahoo.shaadi.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
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspam
.....mitvma.mit.edu with SET PICList DIGEST in the body
2003\10\27@145702
by
piclist
2003\10\27@155834
by
llile
2003\10\27@164233
by
Russell McMahon
> > char i;
> > i= 9;
> > do{
> > some stuff
> > }while(--i < 9 );
> >
> > will define behavior for every possible value of i.
>
> I think you meant "unsigned char i"? The code above runs the loop 138
> times when "char" is signed.
Well, that's defined behaviour, isn't it ? :-)
RM
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseME
.....mitvma.mit.edu with SET PICList DIGEST in the body
2003\10\27@175636
by
piclist
On Mon, 27 Oct 2003 EraseMEllile
SALTONUSA.COM wrote:
> My favorite compiler defaults to unsigned char, but others
> probably do something different.
Whether a "char" is signed or unsigned is implementation-dependent. A
"char" is meant to store an ASCII character, not to be used as a
general-purpose integer. For this purpose, you'd wanted to specify a
"signed char" or an "unsigned char."
> Some others might assume the number 10 means 0x10 AFAIK.
Perhaps an assembler would, but not a C compiler.
> On Mon, 27 Oct 2003 RemoveMEllileEraseME
EraseMESALTONUSA.COM wrote:
>
> > char i;
> > i= 9;
> > do{
> > some stuff
> > }while(--i < 9 );
> >
> > will define behavior for every possible value of i.
--
John W. Temples, III
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUT
KILLspammitvma.mit.edu with SET PICList DIGEST in the body
More... (looser matching)
- Last day of these posts
- In 2003
, 2004 only
- Today
- New search...