[SOLVED] How to configure PIC16F as I2C Slave

Status
Not open for further replies.

ProminentRD

Newbie
Joined
May 8, 2021
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
20
I'm on a project with dspic30f as Master and pic16f1705 as slave. The master is not receiving Acknowledgement from slave. I configured Master myself and used 'MCC' for generating Salve's code. Master is sending clock and data, however the the acknowledgement bit stays high. I have uploaded both the codes. Please help if someone knows to solve the problem
 

Attachments

  • TEMP_SLAVE.X.rar
    419.8 KB · Views: 140
  • TEMPPMaster.X.rar
    37.1 KB · Views: 109

I'd check correct I2C unit configuration and reaction to incoming I2C communication on the slave side with in-circuit debugger.
Thanks bro, did the same and I figured it out. It was a simple address mismatch. The MCC generated code shifted a bit to left side (<<1). I just removed that.
In the datasheet it was said that the LSB was neglected so had to do it accordingly
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…