Pablo Suarez

MC9S08SH8 Flash Program & Erase

Discussion created by Pablo Suarez on Apr 19, 2011
Latest reply on Aug 20, 2014 by David Durantini

Hi there, I need your help!

I need to program some bytes in the Flash Sector of my SH8 in Burst mode but I can't understand how to do this.

In the flash section of the SH8 Data Sheet I found all the information about how to program in Burst mode with even an flow chart but it don't explain where is the Data Buffer and Address to be written in the flash sector.

I made code for MCHC08 microcontrollers for this aplication and the address and data had an specific place in RAM.

 

 

1. The first thing to do is set the internal Clock divider register (FCDIV). OK

2. Clear any error flag (FACCERR). OK

3. Wait until Command Buffer is empty. OK

4. Write to Flash to Buffer Adress and Data. ¿?

     Where is this Buffer and Address Data? How can I specify the address and Data to be written in Flash?

5. Write Command. OK

6. Write 1 to FCBEF to Launch Command. OK

7. Test FACCERR and FPVIO for errors. OK

8. Wait for Flash Command Complete Flag FCCF. OK

 

 

Well, I know it should be simple but where is the explanation.

 

Thahks a lot for your time.

 

Pablo Suárez from Buenos Aires.

Outcomes