| Electronic Components Datasheet Search |
|
AN2635 Datasheet(PDF) 13 Page - Freescale Semiconductor, Inc |
|
|
|||||||||||||||||||||||||||||
AN2635 Datasheet(HTML) 13 Page - Freescale Semiconductor, Inc |
|
13 / 36 page ![]() How to Use the Routines On-Chip FLASH Programming Routines, Rev. 4 Freescale Semiconductor 13 Example 6: Programming a Range Smaller than a Row PRGRNGE can be used to program a range less than 32 bytes. Example 6 shows how to program $55 and $AA at location $E004 and $E005, respectively. PRGRNGE equ $038A ;LB8 PRGRNGE jump address mov #$55,DATA mov #$AA,DATA+1 mov #$18,CPUSPD ;fop = 6.0MHz in this example ldhx #$E005 ;Load last address to LADDR sthx LADDR ldhx #$E004 ;Load beginning address to H:X jsr PRGRNGE ;Call PRGRNGE routine ERARNGE ERARNGE can be called to erase a page (64 bytes) or a whole array of FLASH. Registers H and X can be any address within the page or array to be erased. To select erase size, CTRLBYT is used. Writing $40 to CTRLBYT selects the entire array (MASS) erase. Writing $00 to CTRLBYT selects the page erase. When other values are written to CTRLBYT, the erase operation is not executed. This routine supports an internal operating frequency between 1.0 MHz and 8.4 MHz. In this routine, both PAGE erase time (tErase) and MASS erase time (tMErase) are set between 4 ms and 5.5 ms. The CPUSPD value is the nearest integer of fop (in MHz) times 4. For example if fop is 3.1 MHz, the CPUSPD is 12 ($0C). If fop is 4.9152 MHz, the CPUSPD is 20 ($14). Interrupts are masked and the COP is serviced in ERARNGE. The first COP is serviced on (40+3xCPUSPD) bus cycles after this routine is called in the user software. Entry Condition CTRLBYT — For MASS erase, write $40. For PAGE erase, write $00. H:X — Contains an address within a desired erase page or an array. CPUSPD — Contains the nearest integer value of fop (in MHz) times 4. Exit Condition None |
|
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 |