We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am trying to write a boostrap code for the XC164 but it doesn't seem to start up right. As I understand from the datasheet the bootstrap section starts at 0xE00000 and the start of the bootstrap code at 0xE00024. Is that right??
$MODV2 $CASE ; Case Sensitive Symbols $INCLUDE (REG164.INC) ; Addresses for XC16x/Super10 Devices ADR_BOOTSTART EQU 0E00000H ;******** Boot Loader Part ************************************************** ; Historic Parameter for old CPU's ; BOOT960 = 0: C167 CPU with 32 Byte Bootstrap loader is used ; BOOT960 = 1: C167 CPU with 960 Byte Bootstrap loader is used $SET (BOOT960 = 0) ASSUME DPP3:SYSTEM FlashOSCode SECTION CODE AT ADR_BOOTSTART FlashOS PROC NEAR $IF NOT (BOOT960) START: MOV R0,#0024H ; Start of bootstrap code LAB1: JNB S0RIC.7,LAB1 ; when CPU expects 32 Bytes EXTS #0E0H,#1 MOVB [R0],S0RBUF BCLR S0RIC.7 CMPI1 R0,#SOF(ENDBOOT)-1 JMPR CC_NZ,LAB1 $ENDIF DISWDT ; Start of bootstrap code MOV STKOV,#0FA00H MOV STKUN,#0FC00H MOV CP,#0FA00H ; Register Bank at 0FA00H MOV DPP3,#3H MOV DPP2,#3H MOV DPP1,#3H EINIT RESTART: MOV SP,#0FBF0H ; System Stack Pointer MOV R0,#0FA40H ; User Stack Pointer MOV TFR,ZEROS MOV PSW,ZEROS ;******** Command Processor ************************************************** ; CALL ERASE_FLASH CMD_LOOP: MOV RL4,#'E' ; FLASH ERASED CALL PUTCHAR ; PUTCHAR MOV R7,#0030H ; STATUS OK
The boostraploader has to use the 2K PSRAM (0xE00000 to 0xE007FF) 0xE00000 to 0xE00003 is used by the boostraploader mechanism for disable watchdog 0xE00004 to 0xE00023 is the location for the first loader that will startet automatical after receiving the 32 bytes via ASC0. 0xE00024 to 0xE007FF is the location for a secondary loader that loads the firmeware Regards Bernd Paul