From 5510e238ce1a88b779f4d183a8b6dbd17e35ddca Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sat, 20 Jul 2013 13:26:47 +0000 Subject: com spi for 887 now fits within flash boundary TODO: test this - not sure if this works... git-svn-id: https://svn.spreadspace.org/pic/trunk@89 a09c6847-51d9-44de-8ef2-e725cf50f3c7 --- bootloader/com-16f887-spi.inc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'bootloader/com-16f887-spi.inc') diff --git a/bootloader/com-16f887-spi.inc b/bootloader/com-16f887-spi.inc index e4b8d2a..08a3b84 100644 --- a/bootloader/com-16f887-spi.inc +++ b/bootloader/com-16f887-spi.inc @@ -20,8 +20,6 @@ ;; along with spreadspace pic utils. If not, see . ;; -#define INTPIN PORTA,4 - ;; --- transmit byte and add it to csum com_tx_byte movwf SSPBUF @@ -53,12 +51,11 @@ com_rx_got_byte movf SSPBUF,w return - ;; ----- initialize com (not a subroutine, com_init is called by generic_init + ;; ----- initialize com (this is called by bootmacro, it's not a subroutine - no return at the end) com_init - ;; bank 3 - bsf STATUS,RP0 - bsf STATUS,RP1 - bcf ANSEL,ANS4 ; RA5/SS as digital input + ;; bank 3 - we are already there, see bootmacro + btfsc BOOTPIN + goto USERVECT ;; bank 1 bcf STATUS,RP1 @@ -68,7 +65,7 @@ com_init movwf SSPSTAT bcf TRISC,5 ; RC5(SDO) = out bcf INTPIN ; interrupt line to master - + ;; bank 0 bcf STATUS,RP0 movlw b'00100100' ; SSPEN=1,CKP=0,SSPM=0100(SPI Slave with SS) -- cgit v1.2.3