View previous topic :: View next topic |
Author |
Message |
sorasit46
Joined: 07 May 2007 Posts: 69
|
How second pic received data from first pic? |
Posted: Wed Feb 20, 2008 12:14 am |
|
|
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
|
|
Posted: Wed Feb 20, 2008 8:34 am |
|
|
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
|
sorry! reask again |
Posted: Wed Feb 20, 2008 10:20 am |
|
|
Who have example source code?
thanks |
|
|
|