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.

connceting a PIC to another

Status
Not open for further replies.

ambition

Junior Member level 2
Joined
May 28, 2005
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,483
hi

just a very small and quick question ...

if I want to connect one PIC to another
considering that one of them will give commands to the other to start a certain job

how can this be done ?
I mean , do the first one (explained above ) will act as the other one is an IO ??

I would be thankful is someone can help in this :)
 

as long as tey hav same logic level(say 5V hi for both) and same power supply there is no harm connecting directly, say u hav 2 mcus '1' & '2'. u want to send data form '1' to '2'. u can send data serialy/paralally. for serial u need 2 pin of mcu '1' as o/p and of '2' i/p. one u can use as data and another one as clock, also ucan hav a extra pin for acknoledge ment which will be i/p to '1' and o/p to '2'

for paralell data txmission u can declare a whole port of '1' as o/p and i/p of '2'

btw i did these with PICs

regards
 

Dear ambition,

If both PICs have a built-in USART peripheral, are physically close to one another, and operating at the same voltage, you may connect both PICs together directly using the TX and RX pins (crossed between PICs)... If the distance is greater or if the PICs are located in an electrically noisy environment you may wish to connect the USART ports together using RS232 or RS485 interface ICs...

You can also "bit bang" asynchronous serial data using 1 or 2 pins or "bit bang" synchronous data using 2 or 3 pins...

I suspect there are many many different ways to convey data between two PICs... I hope I may have provided you with some useful ideas...

Regards, Mike
 

you can also use I2C and Spi for this perpose ,
if you want more speed than uart you can use i2c , it use 2 pin like UART but it's Synchronous and alittle harder to use .
but CCS and other compiler have many build in function for using I2C ...

good luck
 

HI,

How many tasks your pic have to change? If they are few, you can try a simple communcation implementing something like a encoder decoder. If you nned to change 2 tasks you can set an output 0 or 1 for tasks and read the PIN in second PIC.If you need 4 tasks you can use 2 pins, 3 pins for 8 tasks and so on...

You can also try to use direct serial communication(rs232) without level translation(rs485) if pics are on the same board. Its simple. you can implement rs232 serial communication by software if pic hasn't got an HW one.

I found dufficulties using I2C.... slave didn't decode signals from master.... i can't understand why.
 

THERE ARE MANY WAY,SUCH AS INTERUPT ,COMMUNICATION BETWEEN MCU.
 

xmli1976 said:
THERE ARE MANY WAY,SUCH AS INTERUPT ,COMMUNICATION BETWEEN MCU.

to be presice interupt is not a 'way' to communicate, it's a tool/process for that, e.g. if u r using usart module then u can use PIR1.RCIF interrupt register to perform any specific task upon reception of data. or according to my above customized communication system u can use RB0 pin as interrupt for acknowledgement (INTCON.RBIF)

regards
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top