Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

SPI protocol in PIC16877a microcontroller

Status
Not open for further replies.

vijiembed

Newbie level 5
Newbie level 5
Joined
Jul 8, 2008
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,331
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....
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top