CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Communication PIC16F to PIC16F with i2c and CCS

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
AKA TENDO



Joined: 25 Jan 2023
Posts: 47

View user's profile Send private message

Communication PIC16F to PIC16F with i2c and CCS
PostPosted: Thu Jan 26, 2023 4:06 am     Reply with quote

Hi everybody, im working on a project wher i have to make 2 pic16f communicate. I've found some examples on internet but no one with pic16f this is why im posting on this forum. This is the link of the only good example that i have :
http://hades.mech.northwestern.edu/index.php/I2C_communication_between_PICs

Any ideas are welcome.

Best regards.
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 4:09 am     Reply with quote

There are examples for master and slave communication in the examples
folder for the compiler. The '16F' makes no difference at all, provided the
PIC's you are using have the MSSP peripheral. A slave requires the hardware
peripheral, so cannot be done on a PIC that does not have this.
AKA TENDO



Joined: 25 Jan 2023
Posts: 47

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 7:49 am     Reply with quote

Ttelmah wrote:
There are examples for master and slave communication in the examples
folder for the compiler. The '16F' makes no difference at all, provided the
PIC's you are using have the MSSP peripheral. A slave requires the hardware
peripheral, so cannot be done on a PIC that does not have this.


i found it, thank you.
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 8:24 am     Reply with quote

Also look in the code library. There is at least one example pair there.
AKA TENDO



Joined: 25 Jan 2023
Posts: 47

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 8:27 am     Reply with quote

Ttelmah wrote:
Also look in the code library. There is at least one example pair there.


Excuse me but what do you mean by "code library"?
Ttelmah



Joined: 11 Mar 2010
Posts: 19217

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 11:17 am     Reply with quote

Aaargh!.....

You do realise this is not the only part of this forum.

Above the top bar of the forum itself, to the right of the button 'new topic',
there is a label 'CCS Forum Index'. Click on this, and you have a list of
half a dozen forum sections. The second one down is the Code Library.
Here people post code 'of interest' to members. Select this. There are some
of the most important code pieces here. For example PCM's I2C bus scanner
program (vital when working with I2C), and the Flex LCD driver.
In there, there is an I2C Master and Slave example.
temtronic



Joined: 01 Jul 2010
Posts: 9101
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 11:24 am     Reply with quote

in the FAQ section of the CCS manual there's an easy way to connect 2 PICs using 1 wire, or of course 'RS232' can be used...

Hmm do you HAVE to use I2C ? I just offered other ways it can be done, but if the teacher says 'I2C', then you'll need to use I2C.

Be sure to have the I2C bus pullup resistors. usually 4k7 if VDD is 5 volts.


Last edited by temtronic on Thu Jan 26, 2023 3:09 pm; edited 1 time in total
AKA TENDO



Joined: 25 Jan 2023
Posts: 47

View user's profile Send private message

PostPosted: Thu Jan 26, 2023 12:56 pm     Reply with quote

Thank you guys for your answers ^^, excuse me for my stupid questions but this is my first time on this forum.
We reached to send data to slave but i think your answers will help me to improve the code. I will check tomorrow if we need something else then i might post again, thanks you guys. Best regards.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group