Hi Peter, I have used SPI on PIC16C73 in slave mode to catch data sent to MAX7213 LED display driver. As far as I remember, it worked without much troubles. Extracted code below. The underscored bit names are #defines including the proper register, like #define _C STATUS,0 Josef CBLOCK __GPRAM TEMPW, TEMPS, TEMPF FLAGS ... SSPADR... .... ENDC CBLOCK 0x60 SSPDAT:SSPBLEN ENDC #define _FSSPDT FLAGS,6 ; ================================================================ ; INTERRUPT--INTERRUPT--INTERRUPT--INTERRUPT--INTERRUPT--INTERRUPT ; ================================================================ ORG 4 _INT_SAVE_REG TEMPW, TEMPS SSPINT: BTFSS _SSPIF GOTO INTER BCF _SSPIF BTFSC _FSSPDT ;flag indicates if address or data GOTO SSPI0 ;was received, it is MAX7213 specific MOVF SSPBUF,W ADDLW SSPDAT MOVWF SSPADR BSF _FSSPDT GOTO IEND SSPI0: MOVFF FSR,TEMPF MOVFF SSPADR,FSR MOVFF SSPBUF,INDF MOVFF TEMPF,FSR GOTO IEND INTER: BTFSS _INTF ;RB0 connected to CS of Maxim GOTO IEND BCF _INTF BCF _FSSPDT BSF _FDSUPD ;GOTO IEND IEND: _INT_RESTORE_REG TEMPW,TEMPS RETFIE SPI inicialization: LDB SSPCON,B'00110101' ;ENABLE SPI SLAVE, RECEIVE ON RISING EDGE LDB RCSTA,1<b) Does anyone have code snippets to share using BSSP or MSSP modules to >implement >SPI slave mode in a PIC ? >I find the documentation somewhat poor from Microchip. There are plenty >examples of IIC and SPI master mode >but when it comes to SLAVE mode then the app. notes lack. > ======================================================================= Electronical devices for chemical laboratory, custom electronics design ----------------------------------------------------------------------- Snail Instruments Josef Hanzal, M. S. Vojanova 615 phone/fax: +420-311-624433 266 01 Beroun e-mail: snail@iol.cz Czech Republic URL: http://www.vitrum.cz/snail/ GPS: 49deg58'28" North, 14deg 4'35" East ======================================================================= -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads