OK.
I am happy to help.
It is difficult to give meaningful advice if I don't have have a clear understanding of exactly what you are trying to achieve.
Why are you using assembly code to work with PIC's user specified pins for the SPI I/O when the Oshonsoft Basic could be used with the PIC's internal SPI regs.?
E
Define SPI_CS_REG = PORTB
Define SPI_CS_BIT = 5 'the PCB is marked CSN, Orange
Define SPI_SCK_REG = PORTB
Define SPI_SCK_BIT = 4 'White
Define SPI_SDI_REG = PORTB
Define SPI_SDI_BIT = 1 'Blue 10K pu.
Define SPI_SDO_REG = PORTB
Define SPI_SDO_BIT = 2 'Green
SPIPrepare
Example of a SPI Func:
Function rd_fifo(arg1 As Byte) As Byte
SPICSOn
SPISend 0xa0
WaitUs 10
SPIReceive fifo
WaitUs 10
SPICSOff
End Function
I am happy to help.
It is difficult to give meaningful advice if I don't have have a clear understanding of exactly what you are trying to achieve.
Why are you using assembly code to work with PIC's user specified pins for the SPI I/O when the Oshonsoft Basic could be used with the PIC's internal SPI regs.?
E
Define SPI_CS_REG = PORTB
Define SPI_CS_BIT = 5 'the PCB is marked CSN, Orange
Define SPI_SCK_REG = PORTB
Define SPI_SCK_BIT = 4 'White
Define SPI_SDI_REG = PORTB
Define SPI_SDI_BIT = 1 'Blue 10K pu.
Define SPI_SDO_REG = PORTB
Define SPI_SDO_BIT = 2 'Green
SPIPrepare
Example of a SPI Func:
Function rd_fifo(arg1 As Byte) As Byte
SPICSOn
SPISend 0xa0
WaitUs 10
SPIReceive fifo
WaitUs 10
SPICSOff
End Function