On 20/02/2011 18:34, Carl Denk wrote: > I have an 18F4320 with 8mz crystal and a DS1307 RTC, and trying to set > up the Library I2C (Not software) to drive the DS1307. In the 18F4320 > Data sheet, Table 17-3 (I2C Clock with W/BRG) There are FOSC values of > 40, 16, 10, and 4 mhz., but not 8 mhz. that I have. What value should I > use for SSPADD? I am following the example here: > http://www.microchip.com/forums/tm.aspx?m=3D515040&high=3DI2C+DS1307. > > Any other thoughts appreciated too. :) Looking at the tables and comparing the values, it looks like the=20 formula is Fcy / (BRG + 1) So for 100 kHz @ Fosc 8MHz it would be 2MHz / (19 + 1) =3D 100 kHz. (19 is= =20 in decimal =3D 0x13 for hex) (Fcy is instruction cycles =3D Fosc / 4) --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .