diff options
author | Christian Pointner <equinox@spreadspace.org> | 2013-07-12 02:33:32 +0000 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2013-07-12 02:33:32 +0000 |
commit | ffdaa38e67a915dec7e053e39912f57504f8e2c4 (patch) | |
tree | c9210eefed1b548fd953afb91d94d932e3b92cd7 /bootloader/com-16f887-spi.inc | |
parent | started support for com-spi for 16f887 (diff) |
added spi send - still to long (but only 1 word)
git-svn-id: https://svn.spreadspace.org/pic/trunk@86 a09c6847-51d9-44de-8ef2-e725cf50f3c7
Diffstat (limited to 'bootloader/com-16f887-spi.inc')
-rw-r--r-- | bootloader/com-16f887-spi.inc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/bootloader/com-16f887-spi.inc b/bootloader/com-16f887-spi.inc index 7f501cf..e4b8d2a 100644 --- a/bootloader/com-16f887-spi.inc +++ b/bootloader/com-16f887-spi.inc @@ -20,10 +20,20 @@ ;; along with spreadspace pic utils. If not, see <http://www.gnu.org/licenses/>. ;; +#define INTPIN PORTA,4 + ;; --- transmit byte and add it to csum com_tx_byte - ;; TODO add write + movwf SSPBUF + bcf INTPIN xorwf csum,f + bsf STATUS,RP0 +com_tx_byte_wait + btfss SSPSTAT,BF + goto com_tx_byte_wait + bcf STATUS,RP0 + movf SSPBUF,w + bsf INTPIN return ;; ---- wait for byte to be received @@ -57,8 +67,10 @@ com_init movlw b'01000000' ; SMP=0,CKE=1 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) movwf SSPCON + bsf INTPIN |