Hi,
This may have already been addressed but can't find it so please point me in the right direction.
I am using 18F46K22. My project is simple at this stage just trying to get two pic to talk to each other via I2C. I want Pic A to send a request to Pic B for an ADC value and to display this value on an LCD. Then if this value is a certain value Pic A to send a request to Pic B to turn on an LED. What I am asking is, is there a I2C tutorial or the like to get two PICs talking to each other?
Cheers
JOHN
PIC to PIC Comms
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: PIC to PIC Comms
Check this blog post (Slave is available in the current release)
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
Re: PIC to PIC Comms
Thanks, am now trying to work on RS232. Again to no avail. Could someone please have a look at my progs and tell me what I'm doing wrong. Hardware wise the two pics are connected together via TX1 and RX1 (25 & 26), and yes Tx-Rx.
Cheers
John
Cheers
John
- Attachments
-
- RS232B.fcfx
- (9.65 KiB) Downloaded 273 times
-
- RS232A.fcfx
- (10.5 KiB) Downloaded 263 times
- QMESAR
- Valued Contributor
- Posts: 1287
- Joined: Sun Oct 05, 2014 3:20 pm
- Location: Russia
- Has thanked: 384 times
- Been thanked: 614 times
Re: PIC to PIC Comms
Hi
I made a small example for you which show how you can use the RS232(UART) component to make two PIC's talk
you will see that PICA reads a analog signal at AN0 (a byte) then send it to PICB over UART ,PICB receives the byte in the UART Rx Interrupt and disiplay the value of the AN0 signal on PORTB .
as you change the signal on PICA AN0 the leds on PICB will follow the Analog to digital conversion done by PICA.
You need only to change the devices selected to your devices and do the configuration
my Projects use PICA = PIC18F45K22, PICB = PIC18F4585
The Connections between the 2 PIc's is as follows
PICA PICB
Rx --> Tx
Tx --> Rx
Gnd Gnd
this is how it look on my test board
Hope this helps you
I made a small example for you which show how you can use the RS232(UART) component to make two PIC's talk
you will see that PICA reads a analog signal at AN0 (a byte) then send it to PICB over UART ,PICB receives the byte in the UART Rx Interrupt and disiplay the value of the AN0 signal on PORTB .
as you change the signal on PICA AN0 the leds on PICB will follow the Analog to digital conversion done by PICA.
You need only to change the devices selected to your devices and do the configuration
my Projects use PICA = PIC18F45K22, PICB = PIC18F4585
The Connections between the 2 PIc's is as follows
PICA PICB
Rx --> Tx
Tx --> Rx
Gnd Gnd
this is how it look on my test board
Hope this helps you

- Attachments
-
- PIC_PIC_UART.zip
- (415.94 KiB) Downloaded 263 times
-
- 1.jpg
- (396.3 KiB) Downloaded 1758 times
https://www.flowcodexchange.com/
Regards QMESAR
Regards QMESAR