I2C baud rate change alters system clock??

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

I2C baud rate change alters system clock??

Post by GTF »

Hi
Not sure where to put this.......
I just noticed that if I select an I2C Master component baud rate of 1 MHz rather than 100kHz or 400 kHz my LEDs are flashing at least twice as fast. This is with a 18F14K50, 12MHz res, 4xPLL, no CPU divide. I did a compare of the 2 ASM files and the only difference is the value for SSPADD in the I2C initialization. I don't see anything in the Errata for this chip that seems to relate to this. http://www.itonet.co.jp/DataSheets/Micr ... errata.pdf

There is the following note in the datasheet http://ww1.microchip.com/downloads/en/D ... 41350E.pdf (p. 167) "Note 1: The I2C interface does not conform to the 400 kHz I2C specification (which applies to rates greater than 100 kHz) in all details, but may be used with care where higher rates are required by the application."

Has anyone else experienced this?

GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

Re: I2C baud rate change alters system clock??

Post by GTF »

Curiously, although I was able to reproduce the above behavior multiple times yesterday, on 2 different circuit boards, the same hex files seem to behave properly when programmed on the same hardware today. I assume this is somehow an issue with the Pickit 3 hardware/software which is now more cooperative after a nights rest/reboot.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C baud rate change alters system clock??

Post by Benj »

Hello,

That sounds like a strange problem, maybe your right the PICkit was tired! :D

If it starts to happen again then let us know and we can try and help you find out what's going on. Wonder if something was causing the PLL to become unstable?

Do you have the Slew rate or SM bus settings enabled for the I2C component?

GTF
Posts: 170
Joined: Sat Dec 10, 2011 7:21 pm
Location: Canada
Has thanked: 20 times
Been thanked: 52 times
Contact:

Re: I2C baud rate change alters system clock??

Post by GTF »

Thanks Benj. Both were disabled.

Post Reply