View previous topic :: View next topic |
Author |
Message |
Jesse
Joined: 07 Sep 2021 Posts: 7
|
dsPIC33CH512MP508 I2C on slave core |
Posted: Fri Nov 19, 2021 7:57 am |
|
|
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 |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19495
|
|
Posted: Sun Nov 21, 2021 3:03 am |
|
|
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
|
|
Posted: Mon Nov 22, 2021 1:25 am |
|
|
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. |
|
|
|