CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Guidance Required About SPI

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

Guidance Required About SPI
PostPosted: Mon Feb 25, 2008 1:03 am     Reply with quote

Hi everyone,
I want to communicate two pic's (pic16f877a) through SPI. I have never used SPI before. I want some basic and simple tutorials in C language like send the command from 1st pic and on the 2nd pic the led is on or off either on any port.
i have basic knowledge of how to connect two pics physically/hardware wise.
Plz give me some tutorials. I am using CCS compiler version 4.020. I have searched and find a lot of things but they are at high level and i can't understand it. That's why i want to start it from beginning.
Plz help me out.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 25, 2008 11:44 am     Reply with quote

Look at these two CCS example files:
Quote:

c:\program files\picc\examples\ex_spi_slave.c
c:\program files\picc\examples\ex_spi.c
hayee



Joined: 05 Sep 2007
Posts: 252

View user's profile Send private message

PostPosted: Mon Feb 25, 2008 11:31 pm     Reply with quote

PCM PROGRAMMER i have also seen that example but unable to understand.I install both program in two pics and when i run it the message appears in Hyper Terminal that is

Read or Write:
Read or Write:

but when i press R or W nothing will be happens.why is it?
have u any other simple example or can u write any simple example for me.
thanks.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Feb 25, 2008 11:57 pm     Reply with quote

The demonstration program shown in my post runs on one board
(not two boards). It demonstrates an SPI slave:
http://www.ccsinfo.com/forum/viewtopic.php?t=26888
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group