Does someone have a simple piece of code written in C on how to operate the SPI port. I have downloaded the data manual for the PIC16F877A but being a bit simple. I am still confused.
Here is what I've done so far
#include<system.h>
void main()
{
Trisc= 11000111; \\ setup port c
sspstat= 11000000; \\ set sspstat as manual show
sspcon= 00110010; \\ Enable serial port and set clock speed to fosc/64.
sspbuf=10101010; \\ Test data to be sent.
}
This is as far as I could work out . I know I need to send the data out of RC5 somehow but am not sure how to go about this.
I have tried the bit banging method which you helped me with before which was greatly appreciated(which work well). But would really like to learn more about spi port.
All help greatly received Dave Halliday
![Question :?:](./images/smilies/icon_question.gif)