Quantcast
Channel: Microcontrollers
Viewing all articles
Browse latest Browse all 4923

Check if SPI transmission is complete in PIC18.

$
0
0
Hello.
As far as I know, the check if SPI transmission is complete can be made looking at SSPSTAT,BF flag:

Code:
movwf SSPBUF
LOOP
btfss SSPSTAT, BF ;CHECK IF TRANSMISSION IS COMPLETE
goto LOOP
bcf SSPSTAT,BF

or looking at PIR1,SSPIF interrupt flag:
Code:
movwf SSPBUF
LOOP
btfss PIR1, SSPIF ;CHECK IF TRANSMISSION IS COMPLETE
goto LOOP
bcf PIR1,SSPIF

I don’t understand when to use one and when to use the other.
What’s the difference, if any?
I found cases where checking...

Check if SPI transmission is complete in PIC18.

Viewing all articles
Browse latest Browse all 4923

Trending Articles