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 CCS Technical Support

dsPIC33CH512MP508 I2C on slave core

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



Joined: 07 Sep 2021
Posts: 7

View user's profile Send private message

dsPIC33CH512MP508 I2C on slave core
PostPosted: Fri Nov 19, 2021 7:57 am     Reply with quote

Hello,

I'm working on a dsPIC33CH512MP508. This is a dual core chip. I want to address another chip using I2C on the slave core to read data and send this to the master core of the same chip using mailbox or FIFO.

Does anybody have any example code for the i2c communication for the slave core ? I already have I2C communication on other chips (PIC24).

If I try to use the I2C alternate pins on the slave core and try to send messages by I2C the slave core gets freezed.....

All help is welcome Smile
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Sun Nov 21, 2021 3:03 am     Reply with quote

A lot of the time, CCS 'misses' the correct TRIS setup, when you use
alternate pins. So manually set the tris on these pins.
Obviously you are aware that only I2C1 can be used by the slave.
Personally, I'd try an experiment doing software I2C first, to prove that
everything up to this point is working. Also I'd probably just use DMA for
the I2C, rather than the slave core.
Are you using the standard I2C functions or the i2c_transfer functions?.
I've always found these newer functions very troublesome.
I've found the slave chip operations in the earlier compilers had a lot of
issues, They do seem to be improving, but I think you are going to have
to post some example code, and/or talk to CCS to try to track down what
is wrong here.
Jesse



Joined: 07 Sep 2021
Posts: 7

View user's profile Send private message

PostPosted: Mon Nov 22, 2021 1:25 am     Reply with quote

Thank you for your reply.

- I will manually set the tris.

- Yes, I'm aware I can only use the I2C1. And I'm now only testing the I2C code. (according to the datasheet PIN C8 and C9 for slave alternate pins)

- The reason I use the slave core for I2C is, because I need the Master core for other processes and than the slave core can communicate with slave cores of other chips.

- I use standard I2C functions, which I also use for my I2C code for the PIC24.

- CCS stated it was compatible with this chip, so I need to have a look and otherwise inform more.
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