
Originally Posted by
bugi
Hi Les,
How can I use MSSP module with PROTON ?
I found only I2C command but there are not any MSSP command.
Regards.
Depending on the SPI mode your app requires, see page 193 if a PIC18F2XK20 for example.
Everything can be found in the registers.
SPI both sends and receives a byte at the same time.
Sometimes you only would require receiving so just send $FF for example.
Norm
Code:
'********************
'MSSP = MASTER SYNCHROUS SERIAL PORT MODULE ' SPI Port Setup
'SSPSTAT = 000000 'BOTH WORK SD card
SSPSTAT = 000000 'BOTH WORK SD card
SSPCON1 = 100010 ' SLOW INITILIZE SLOW
' SSPCON1 = 100000 'FAST
SSPCON1 = 100001 ' MED
SSPBUF = $FF 'SENDS 1 BYTE TO SD
While SSPSTAT.0 = 0: Wend 'WHILE TX/RX COMPLETE
yBUFF_ARRAY256[dWRITE_BUFF_TOTAL.Byte0] = SSPBUF
Inc dWRITE_BUFF_TOTAL