|
|
View previous topic :: View next topic |
Author |
Message |
codewrecker2
Joined: 23 Dec 2005 Posts: 23
|
Data eeprom issue |
Posted: Wed Feb 08, 2006 4:58 am |
|
|
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
|
Re: Data eeprom issue |
Posted: Fri Mar 03, 2006 6:33 am |
|
|
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
|
|
Posted: Fri Mar 03, 2006 7:00 am |
|
|
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... |
|
|
|
|
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
|