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 support@ccsinfo.com

How second pic received data from first pic?

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



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

How second pic received data from first pic?
PostPosted: Wed Feb 20, 2008 12:14 am     Reply with quote

I want the first pic send data to second pic. How second pic received data from first pic? ( I want source code command.)
Ex.
/****** first pic *****/
#include <12F675.h>
.
.

#define dataout pin_a5 // data output
.
.
void main()
{
byte table[3]={0x3F,0x06,0x5B}; // {0,1,2}
byte data[3];
data[0]=table[0];
data[1]=table[1];
data[2]=table[2];
.for (i_send=1;i_send<=24;++i_send) output_bit(dataout,shift_left(data,3,0);

.
.
}

on second pic (such as 12F675) . How can received data 0,1,2 from master pic ?

/****** second pic *****/
#include <12F675.h>
.
.

#define datain pin_a4 // data input
.
.
void main()
{
.
.
.what command to get data input from pin_a4?;
.
.
}

regards


Last edited by sorasit46 on Wed Feb 20, 2008 10:25 am; edited 1 time in total
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Wed Feb 20, 2008 8:34 am     Reply with quote

I don't think this:
output_bit(dataout,0x06);
does what you think it does. The function output_bit only outputs BITS. It can not take 0x06 as an argument. Since dataout is a single digital pin it can only have one voltage value at a time.

If you want to send a byte serially on a pin you need to use the #useRS232() directive with putc() and getc(). If you are just talking PIC to PIC over a short distance with a common ground you do not need RS232 hardware drivers, but you need the RS232 functions. Look for the keywords "RS232" and "serial" to get more info than you can imagine.
_________________
The search for better is endless. Instead simply find very good and get the job done.
sorasit46



Joined: 07 May 2007
Posts: 69

View user's profile Send private message

sorry! reask again
PostPosted: Wed Feb 20, 2008 10:20 am     Reply with quote

Who have example source code?
thanks
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