PDA

View Full Version : SPI Communication between two pic 16f877



anti83
- 5th July 2008, 15:54
Hi, I'm new in the programming of the pic.
I am I try to make to communicate two pic trammite SPI, I have modified the examples found on the site with l' shipment of a variable byte from the pic Slavic to the pic master. I do not succeed to understand because does not work… someone can help me?
Thanks to all and sorry for my bad english :)
Luca

Darrel Taylor
- 5th July 2008, 21:06
Hi Luca,

I haven't looked at the rest of it, but both programs are missing the bottom of the Main loop.

MAIN:
HIGH LED2
IF PORTB.0 = 0 THEN MAIN
B0 = 1
LOW LED2
GOSUB GETDATA
GOTO MAIN

GETDATA:
SSPBUF = "?"
GOSUB LETCLEAR
if SSPBUF<>"!" THEN GETDATA
SSPBUF = 0