Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

pic 16f877a i2c communication 1 master 3 slaves

Kwaku

Newbie
Joined
Jul 2, 2020
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
does anyone have a ccs c code on i2c communication between on master and 3 slaves
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,471
Helped
3,947
Reputation
7,892
Reaction score
3,816
Trophy points
113
Activity points
115,832
Hi,

All you need is
* "I2C slave" code for all the slaves (independent of count. They just need different address)
* "I2C master" code for the master

As long as the code keeps on I2C specifications
* you may use different codes on different slaves. (any code you find)
* master and slave code may come from different sources. (any code you find)

There is nothing special.

Klaus
 

    Kwaku

    points: 2
    Helpful Answer Positive Rating

Kwaku

Newbie
Joined
Jul 2, 2020
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
15
klauss do you have any sample code you can share
 

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,987
Helped
13,938
Reputation
28,124
Reaction score
12,576
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,971
Are you asking about PIC software I2C slaves or hardware slaves? Did you already succeed in communicating with one slave?

Essentially communication with three slaves is just the same, using different slave addresses with first i2c_write( ) command. Did you notice the I2C examples in CCS forum code library?
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,471
Helped
3,947
Reputation
7,892
Reaction score
3,816
Trophy points
113
Activity points
115,832
Hi,
--- Updated ---

klauss do you have any sample code you can share
No. Because the manufacturer has, many compiler development tool providers have and many thousands in the internet.
Maybe even in this forum you may find more than 50 I2C codes for PIC.

Klaus
 
Last edited:

FvM

Super Moderator
Staff member
Joined
Jan 22, 2008
Messages
46,987
Helped
13,938
Reputation
28,124
Reaction score
12,576
Trophy points
1,393
Location
Bochum, Germany
Activity points
273,971
The OP is asking specifically for CCS C code. The tool has a library of built-in functions different e.g. from Mikro-C or Microchip XC8 compilers. You can of course write low level code in any compiler that accesses PIC special function registers directly, but I guess he doesn't want to.
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top