| Electronic Components Datasheet Search |
|
AN1576 Datasheet(PDF) 13 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1576 Datasheet(HTML) 13 Page - STMicroelectronics |
|
13 / 15 page ![]() 13/15 HDFLASH DRIVER 2.3.4 Firmware template #include "io72521.h"/* ST72521 memory and registers mapping */ #include "HDFlash_macros.h" /* HDFlash driver software */ unsigned char tempo; /* stabilization delay used by macro */ /********VPP Supply 1ms stabilization delay********************/ #define Vpp_Enable() { \ ClrBit(PADR,1); \ for (tempo=0;tempo<1000;tempo++); } #define Vpp_Disable() SetBit(PADR,1) /* Disable Vpp macro */ void Loop(void); /*************** Main****************************************/ void main(void) { /******************** Initialization ************************/ ST7_Init(); //General initialization while(1) Loop(); } /*****************UserWhileWriteBlock************************ void UserWhileWriteBlock(void) { WDGCR=0x08; //Refresh WATCHDOG Timer } /*************** UserWhileErase ****************************** void UserWhileErase(void) { WDGCR=0x08; //Refresh WATCHDOG Timer } /****Erasing & Reprogramming routines within External ISR*******/ @interrupt void On_SW1(void) { unsigned int cpt; unsigned char *pFlash; unsigned char ProgBuffer[45] @0x9C; SPI_Init(); //initialize SPI communication SPI_Rx(ProgBuffer,2,100,(char)0); //Receive RASS keys from EEPROM RASS_Disable(ProgBuffer[0],ProgBuffer[1]); //Unlock Flash Vpp_Enable(); HDFlashEraseSector(1,1); //Erase Secor 1 for(cpt=0;cpt<2;cpt++) |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |