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 communication between 16f877a pics

Status
Not open for further replies.

susanka

Newbie level 2
Joined
Jan 5, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,297
I'm trying to communicate two pics(16f877a) using SPI of micrc.It is very greatful if anyone can help me by giving Microc codes and fin diagram.Please give your guidence for success my project.
 

Hi friend,

I'm trying to communicate two pics(16f877a) using SPI of micrc.It is very greatful if anyone can help me by giving Microc codes and fin diagram.Please give your guidence for success my project.

for SPI fin diagram, google Internet,
and for MicroC code,

MicroC Editor has built in library for SPI communication.
and also it give sample code for that.

Shyam
 
Please give me guidance regarding the SPI communication with 2 pics and Mikroc codes.It is very greatfull if any one can give simple Mikroc codes to communicate between two pics(16f877A).I'm giving code that i have tried,but it does not work.Please give your guidance for success my project
// code for spi master
void main()
{
Spi_Init_Advanced(MASTER_OSC_DIV64,DATA_SAMPLE_MIDDLE,CLK_IDLE_LOW,HIGH_2_LOW);
while(1)
{
Spi_Write(0X11);
}
}


// code for spi slave
void main()
unsigned short Spi_Read(unsigned char buffer);
{
unsigned char buffer,gdata=0x00;
buffer=0xFF;
TRISB=0X00;
portb=0X00;
Spi_Init_Advanced(SLAVE_SS_ENABLE,DATA_SAMPLE_MIDDLE,CLK_IDLE_LOW,HIGH_2_LOW);
while(1)
{
gdata=Spi_Read(buffer);
if(gdata==0X11)
{
portb=1;
}
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top