summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-07-24 18:33:23 (GMT)
committerChristian Pointner <equinox@spreadspace.org>2013-07-24 18:33:23 (GMT)
commit3bd2d8d4c94ab3903995f203504220549cf945e8 (patch)
tree009aa550e2059612e1ecce1bf0b17705edcf5ce1
parent5510e238ce1a88b779f4d183a8b6dbd17e35ddca (diff)
fixed bootmacro for 16f1847
git-svn-id: https://svn.spreadspace.org/pic/trunk@90 a09c6847-51d9-44de-8ef2-e725cf50f3c7
-rw-r--r--bootloader/bootloader-947.asm24
-rw-r--r--bootloader/com-16f1847-uart.inc2
2 files changed, 10 insertions, 16 deletions
diff --git a/bootloader/bootloader-947.asm b/bootloader/bootloader-947.asm
index 6c24b29..72cee90 100644
--- a/bootloader/bootloader-947.asm
+++ b/bootloader/bootloader-947.asm
@@ -29,7 +29,6 @@
;; -------------------------------------
;; DEFINES (chip/com specific)
-#define BOOTPIN PORTC,7
USERVECT EQU H'200'
ISRVECT EQU USERVECT + H'4'
FLASH_BOUNDARY EQU b'00011111' ; flash write boundary is at 32 bytes boundaries
@@ -69,9 +68,7 @@ cnt EQU H'007F'
;; Boot Macro
bootmacro macro
- ;; btfsc BOOTPIN
- ;; goto USERVECT
- goto com_init
+ goto preinit
endm
;; for compatibility with older MCUs
@@ -86,6 +83,13 @@ bootmacro macro
;; Bootloader init
#include "generic-init.inc"
+preinit
+ movlb .3
+ bcf ANSELB,ANSB1
+ movlb .0
+ btfsc PORTB,1
+ goto USERVECT
+ goto com_init
;; -------------------------------------
;; Bootloader (com specific subroutines and init)
#include "com-16f1847-uart.inc"
@@ -102,17 +106,7 @@ bootmacro macro
;; -------------------------------------
;; dummy user code
org USERVECT
- movlb .1
- movlw b'11111110'
- movwf TRISB
- movlb .0
-userloop
- call com_rx_byte
- call com_tx_byte
- movlw b'00000001'
- xorwf PORTB,f
- goto userloop
- ;; goto USERVECT
+ goto USERVECT
;; -------------------------------------
;; END
diff --git a/bootloader/com-16f1847-uart.inc b/bootloader/com-16f1847-uart.inc
index b509bb2..961827d 100644
--- a/bootloader/com-16f1847-uart.inc
+++ b/bootloader/com-16f1847-uart.inc
@@ -57,7 +57,7 @@ uart_rx_fe ; recover from framing error
;; ----- initialize com (this is called by bootmacro, it's not a subroutine - no return at the end)
com_init
movlb .1
- movlw b'01110000' ; 8 MHz
+ movlw b'01110000' ; 8 MHz
movwf OSCCON
movlb .3