Page 1 of 1
Communication between 2 microchips
Posted: Wed Feb 03, 2010 11:33 am
by Jan Lichtenbelt
I have two inputs/ouputs left (E0 and E1 of PIC16F877A) and need to send an address and a data byte to an other microchip. What kind of communication do you advise?
Re: Communication between 2 microchips
Posted: Wed Feb 03, 2010 4:29 pm
by Benj
Hello Jan
I would advise using the RS232 in software mode.
There is no buffering for the software mode so you will need to ensure that the receiver is listening by keeping the main loop fairly clear or using flow control or using a INT interrupt pin to flag that an incoming byte is being received. Option 1 or 2 are probably the easiest to implement.
I would get this working using a new set of programs and then once you are happy with the results try and plug it into your existing program.
Re: Communication between 2 microchips
Posted: Thu Feb 04, 2010 4:10 pm
by Jan Lichtenbelt
The alternative is I2C. Is that not easier? What are the advantages/disadvantages?
Re: Communication between 2 microchips
Posted: Thu Feb 04, 2010 5:43 pm
by Benj
Yes I2C is an alternative however I suggest using RS232 as there is currently no I2C slave component for Flowcode and therefore you would have to manipulate the I2C registers using C code to put it into a slave mode. This could be fairly tricky to get working unless you have a good understanding of C.
Re: Communication between 2 microchips
Posted: Fri Feb 05, 2010 8:42 am
by electronix
Why not use RXINT?
Re: Communication between 2 microchips
Posted: Fri Feb 05, 2010 9:48 am
by Benj
RXINT only works with hardware UARTs using RS232. If your in software mode then you have to monitor the input either using flowcontrol or by using a pin interrupt to detect the start bit of the transaction and then collect the data manually.