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

Data eeprom issue

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



Joined: 23 Dec 2005
Posts: 23

View user's profile Send private message

Data eeprom issue
PostPosted: Wed Feb 08, 2006 4:58 am     Reply with quote

guyz,i have been using pic16f689 for a while for a monitoring system,without any problems.but sometimes when i read the data eeprom and put it in a packet for rs232 transmission,it reads the higher byte as FF and lower byte FC(am storing a 16bit number in eeprom,max being 3000) and the other part of the data packet remains intact.i have tried changing the pic,but same problem.
Note:i have taken care while programming to separate the read/write cycles for the pic,so i dont think its because of some read/write clash.does anyone have a clue wotz wrng?
King Virus



Joined: 02 Mar 2006
Posts: 14
Location: Italy

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

Re: Data eeprom issue
PostPosted: Fri Mar 03, 2006 6:33 am     Reply with quote

codewrecker2 wrote:
guyz,i have been using pic16f689 for a while for a monitoring system,without any problems.but sometimes when i read the data eeprom and put it in a packet for rs232 transmission,it reads the higher byte as FF and lower byte FC(am storing a 16bit number in eeprom,max being 3000) and the other part of the data packet remains intact.i have tried changing the pic,but same problem.
Note:i have taken care while programming to separate the read/write cycles for the pic,so i dont think its because of some read/write clash.does anyone have a clue wotz wrng?


Hi codewrecker2 !

Iīm sure that you donīt have enough timeout after writing... I had the same problem a lot of Time ago...and I resolved it by configuring the EEPROM-Write-Complete interrupt. If the interrupt occurs, you can be sure that data was saved in it.
_________________
*** A good forum is a forum where people respect eatch other ! ***
rberek



Joined: 10 Jan 2005
Posts: 207
Location: Ottawa, Canada

View user's profile Send private message

PostPosted: Fri Mar 03, 2006 7:00 am     Reply with quote

I also had this happen recently.

I was building the 16-bit Tx data by shifting the "upper" memory byte left by 8 positions and ORing it with the "lower" memory byte. I had declared the upper byte as an int16, because of the shift, but left the lower byte as an int8 since I wasn't shifting it. This turned out to be a problem, so I declared the lower byte as an int16 and masked it with 0x00ff. Then the unwanted FF's went away.

Dumb mistake on my part, but is was very intermittent in the actual circuit, so I assumed it was noise or something.
_________________
The difference between genius and stupidity is that genius has its limits...
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