diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-07-03 23:55:50 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-07-03 23:55:50 +0000 |
commit | f9d835048b60b886f93b41ee11cb54fe39819796 (patch) | |
tree | 314d44a043acffc8d4f64b6a4b2421fe580e441d /bootloader | |
parent | added 'mess' value to identify (diff) |
added lookup table for commandlength
git-svn-id: https://svn.spreadspace.org/pic/trunk@30 a09c6847-51d9-44de-8ef2-e725cf50f3c7
Diffstat (limited to 'bootloader')
-rw-r--r-- | bootloader/bootloader.asm | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/bootloader/bootloader.asm b/bootloader/bootloader.asm index a1b858e..b32affd 100644 --- a/bootloader/bootloader.asm +++ b/bootloader/bootloader.asm @@ -33,6 +33,7 @@ USERVECT EQU H'100' ISRVECT EQU USERVECT + H'4' FSS EQU 8 +MESS EQU 64 ;; ERROR codes E_OK EQU 0 @@ -71,9 +72,17 @@ CMD_R_CONFIG EQU 7 CCMD_W_CONFIG EQU 'C' CMD_W_CONFIG EQU 8 - ;; ... -CNT1 EQU H'0020' -CNT2 EQU H'0021' + ;; Variables +inbuff EQU H'0020' +inbuff_end EQU H'006F' + +current_cmd EQU H'0070' +current_cmdlen EQU H'0071' + + + +cnt1 EQU H'0070' +cnt2 EQU H'0071' ;; ------------------------------------- ;; Boot test @@ -126,6 +135,18 @@ translate_cmd_codes retlw CMD_W_CONFIG retlw H'FF' +get_cmd_len + addwf PCL,f + retlw 1 ; identify: <csum> + retlw 1 ; boot: <csum> + retlw 1 ; reset: <csum> + retlw 3 ; read flash: addr | <csum> + retlw 3 + FSS ; write flash: addr | data | <csum> + retlw 5 ; read eeprom: addr | len | <csum> + retlw 5 ; write eeprom: addr | len | data | <csum> (minimal) + retlw 2 ; read config: nr | <csum> + retlw 4 ; write config: nr | word | <csum> + ;; ------------------------------------- ;; Bootloader (init) boot @@ -196,14 +217,14 @@ userloop movlw b'00000001' xorwf TRISD,f movlw .255 - movwf CNT1 + movwf cnt1 usercnt1 movlw .255 - movwf CNT2 + movwf cnt2 usercnt2 - decfsz CNT2,f + decfsz cnt2,f goto usercnt2 - decfsz CNT1,f + decfsz cnt1,f goto usercnt1 goto userloop |