summaryrefslogtreecommitdiff
path: root/bootloader/com-16f887-spi.inc
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2013-08-04 17:09:14 +0000
committerChristian Pointner <equinox@spreadspace.org>2013-08-04 17:09:14 +0000
commit1233898b3bcc6e8fc2ac0c2eafc7743aff0f7ee2 (patch)
tree2ffad6e7d75557bf2a430a6ce8de6bd4322f8a8f /bootloader/com-16f887-spi.inc
parentdropped useless supported flags (diff)
improved spi send byte
git-svn-id: https://svn.spreadspace.org/pic/trunk@99 a09c6847-51d9-44de-8ef2-e725cf50f3c7
Diffstat (limited to 'bootloader/com-16f887-spi.inc')
-rw-r--r--bootloader/com-16f887-spi.inc10
1 files changed, 6 insertions, 4 deletions
diff --git a/bootloader/com-16f887-spi.inc b/bootloader/com-16f887-spi.inc
index 4fb41c8..800b1da 100644
--- a/bootloader/com-16f887-spi.inc
+++ b/bootloader/com-16f887-spi.inc
@@ -25,12 +25,14 @@ com_tx_byte
movwf SSPBUF
bcf INTPIN
xorwf csum,f
+ bsf STATUS,RP0
com_tx_byte_wait1
- btfsc PORTA,5
+ btfss SSPSTAT,BF
goto com_tx_byte_wait1
-com_tx_byte_wait2
- btfss PORTA,5
- goto com_tx_byte_wait2
+ bcf STATUS,RP0
+com_tx_byte_wait2 ; also wait for SS to go up again
+ btfss PORTA,5 ; this lowers the risk for raise conditions
+ goto com_tx_byte_wait2 ; with next byte (INT pin)
movf SSPBUF,w
bsf INTPIN
return