spi code problem in pic16f877a

Status
Not open for further replies.

saran

New Member
#include"P16F877A.INC"

REG EQU 0X20
ORG 0X00


GOTO MAIN
ORG 0X100
MAIN
MOVLW B'00010000'
MOVWF PORTC
MOVLW B'11000000'
MOVWF INTCON
BANKSEL PIE1
BSF PIE1,3
BANKSEL SSPCON
MOVLW B'00110010'
MOVWF SSPCON
BANKSEL SSPSTAT
MOVLW B'11100000'
MOVWF SSPSTAT
BANKSEL SSPBUF
LOP
MOVLW .26
MOVWF REG
LOOP
MOVLW 'A'
MOVWF SSPBUF
BTFSS PIR1,3
GOTO $-1
BCF PIR1,3
DECFSZ REG,1
GOTO LOOP
GOTO LOP
NOP
NOP
NOP
END

i am just checking whether the data and clock are generating in pic


this is my asm code in pic16f877a , but i am not getting the desired output
in pin24 & 18
i am using to see the output
 
You are enabling interrupts but have no Interrupt Service Routine. As you are polling for the relevent bit you don't need interupts, therefore, just clr INTCON.

Mike.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…