CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

program counter corruption by EMC

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
sandy wilson



Joined: 25 Feb 2004
Posts: 28

View user's profile Send private message

program counter corruption by EMC
PostPosted: Wed Feb 25, 2004 2:56 am     Reply with quote

Hello Everybody,

I was reading in an EMC book that it is good practice to set all none used memory locations to a NOP command. If the unused blocks are continues place a reset command in the last location. This is so that if the program counter is corrupted by an EMC spike and jumps into an unused memory location it will enact the NOP and once it reaches the end of the block will reset the PIC.

Does anybody know how to do this and know of any other good EMC practices?

Thanks

Sandy Question
burnsy



Joined: 18 Oct 2003
Posts: 35
Location: Brisbane, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed Feb 25, 2004 3:25 am     Reply with quote

One good tip is not to have the tracks on your MCLR pin too long. I had huge problems for a while at a customers premises. My project kept reseting at different times, which I eventually tracked down to my ICSP clip (and cable) attracting spikes from a great big noisy fluro nearby.

And yes I had decent caps to ground on the mclr pin. I have been careful from then on, about the length of the track from my processor to my icsp connector.

Also, I have that great big noisy fluro lamp as standard test equipment in my workshop now..
_________________
This is the last code change until its ready....
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Wed Feb 25, 2004 8:51 am     Reply with quote

If you bulk erase a PIC before programming it gets filled with something like 0x3ff. While that is not the NOP command I think it translates into "W=W+255" which is just as good as NOP
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group