vijiembed
Newbie level 5
pic16877a
hai friends,
I have some doubts in SPI protocol.
Actually, i want to implement SPI with ADC in PIC16f877a microcntroller.
I tried to do this.
My code is,
void main(void)
{
SPI init();
SPI tran();
}
void SPI init(void)
{
TRISC 0b11000111;
SSPSTAT 0b00000000;
SSPCON 0b00110000;
}
void SPI tran(void)
{
SSPIF 0;
SSPBUF 0b10101010;
while(SSPIF 0);
SSPIF 0;
}
Can anybody help me....
hai friends,
I have some doubts in SPI protocol.
Actually, i want to implement SPI with ADC in PIC16f877a microcntroller.
I tried to do this.
My code is,
void main(void)
{
SPI init();
SPI tran();
}
void SPI init(void)
{
TRISC 0b11000111;
SSPSTAT 0b00000000;
SSPCON 0b00110000;
}
void SPI tran(void)
{
SSPIF 0;
SSPBUF 0b10101010;
while(SSPIF 0);
SSPIF 0;
}
Can anybody help me....