EEPROM writing with global address

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EEPROM writing with global address

1,386 Views
Gowri
Contributor I

Hello All,

           I am using S12XEP100 for one of our application,

I have requirement to download block parameters which are addressed in global addressing to EEPROM area.

EEPROM emulation has been enabled prior to download.

I am trying to use the following logic which was not working

 

          while (FSTAT_CCIF == 0) { }
         if(FSTAT&(FSTAT_FPVIOL_MASK | FSTAT_ACCERR_MASK))
         {
                /* Clear any error flags*/
                FSTAT |= (FSTAT_FPVIOL_MASK | FSTAT_ACCERR_MASK);
         }

            /* Write the command id / ccob0 */
             FCCOBIX = 0;
              FCCOBHI = 0x11;                                              /*write command for D-Flash*/
              FCCOBLO = page;

              FCCOBIX=1;
              FCCOB = addr;                                                            /* Write next data word to CCOB buffer. */
              FCCOBIX=2;
              FCCOB = (uint16)(*(dataptr));                               /* Write next data word to CCOB buffer. */
              FCCOBIX=3;
            FCCOB = (uint16)(*(dataptr+1));                           /* Write next data word to CCOB buffer. */
              FCCOBIX=4;
            FCCOB = (uint16)(*(dataptr+2));                           /* Write next data word to CCOB buffer. */
              FCCOBIX=5;
            FCCOB = (uint16)(*(dataptr+3));                           /* Write next data word to CCOB buffer. */

             /* Clear command buffer empty flag by writing a 1 to it */
             FSTAT |= 0x80;
             //FSTAT |= FSTAT_CCIF_MASK;

             while (FSTAT_CCIF == 0) {

             }    /* wait for the command to complete */

 

Can any one help me regarding this.

 

With Thanks & Regards,

Gowrisankar Loganathan

Labels (1)
0 Kudos
2 Replies

472 Views
Bajo
Contributor I

Hi Gowri.

 

I recommend you to read AN3743.

I hope it helps.

 

 

0 Kudos

472 Views
Gowri
Contributor I

Hello Bajo,

         I checked with AN3743, it only recommends to use logical address, but I am looking for writing the EEPROM data using global address.

0 Kudos