I2C with PIC24HJxxx

Beta Testing discussion on mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
norbie
Posts: 160
Joined: 06 May 2006 22:40
Location: Vista, California

I2C with PIC24HJxxx

#1 Post by norbie » 21 Apr 2010 06:25

Here is another mystery I haven't been able to figure out yet.
The PIC24HJxxx data sheet locates the I2C pins at RA2 and RA3 for I2C2 and the RG2 and RG3 pins for I2C1.
I have tried with several Chips to get the I2C working on those pins without success. Other family chips do work!
Leaving the I2C slave device connected to those pins mentioned above and simply converting the code to Soft_I2C does
work flawless. Don't know if I have chips with a problem on the die.
Apparently the port hardware is working, otherwise the Soft_I2C wouldn't work either.
Also, the connection to the slave device isn't long enough to cause problems with stray capacitance. My scope shows
Square Wave Signals on those pins too and not something rounded off or rising edges that would take too long.
Either the BRG isn't calculated correctly or something else gets lost in the course. Perhaps the Clock is too tight?
This happened with 8MHz, 10 MHz, 12 MHz and 16 MHz crystals. In each case the Soft_I2C worked on the same pins.
Although, the hardware I2C produces signals on the ports, they may not be understood by the slave.
Another thought or area to look in.

Cheers,
Norbert
Cheers,
Norbert

You don't need to know the answer, you just need to know where to find it!

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 Beta Testing”