Hi Experts,      I have problem with EEPROM programming,...

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Hi Experts,      I have problem with EEPROM programming,...

ソリューションへジャンプ
1,972件の閲覧回数
sureshkumar
Contributor I
Hi Experts,
 
   I have problem with EEPROM programming, I have code that will program a byte in EEPROM with the parameter send by calling function. But,when it execute, the routine will program the entire 512 bytes instead of just a byte. I confirm my EECR also set to write just 1 byte. My code are below, did my code wrong or is that some other bits in the register I need set in proper way.
 
unsigned char P_OTHER[10]    @0x00000800;         //eeprom address start here
 
unsigned char mydata;
 
void
eeprom_write(unsigned char* add, unsigned char data) {
  
 EECR = 0x06;                          //eelat=1,auto terminate=1
 *add = data;                             //byte to program
 EECR_EEPGM = active;        //turn on programming voltage
 while(EECR_EEPGM);           //wait until programing done
 EECR &= 0xFB;                     //clear eelat and eepgm
}
 
void
funtion_one()
{
   mydata = 'A';
   eeprom_write(&P_OTHER[5],mydata);
}
 
my EEDIV is set to 0x8056, my crystal running on 9.8304MHz. EEPROM clock is set bus clock.
 
Even my erase routine does the same. ex. when I erase just a byte, it goes to entire eeprom array.
I notice all this when I debug the program in MON08. Could you help me out on this.
 
Thanks Guru's 
ラベル(1)
タグ(1)
0 件の賞賛
返信
1 解決策
1,040件の閲覧回数
J2MEJediMaster
Specialist I
Based on the clock speed you're using, I'm going to guess--and could be wrong--that you're trying to program a MC68HC908 derivative. You may want to consult the application note AA2295 which describes a serial bootloader that can handle EEPROM programming. The software is located in the zip file AA2295.zip.

If I'm wrong on the MCU type, I apologize, but this just makes the case where we forum moderators ask:

When you describe your problem, please mention the MCU and CodeWarrior version you're using in the subject line, please!

---Tom

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,041件の閲覧回数
J2MEJediMaster
Specialist I
Based on the clock speed you're using, I'm going to guess--and could be wrong--that you're trying to program a MC68HC908 derivative. You may want to consult the application note AA2295 which describes a serial bootloader that can handle EEPROM programming. The software is located in the zip file AA2295.zip.

If I'm wrong on the MCU type, I apologize, but this just makes the case where we forum moderators ask:

When you describe your problem, please mention the MCU and CodeWarrior version you're using in the subject line, please!

---Tom
0 件の賞賛
返信