Any PIC/SFR Experts?

Armp

Senior Member
I2Csetup says:
Advanced Technical Information:
Users familiar with assembler code programming may choose to create their own
‘mode’ settings to adjust the i2c communication speed. The mode value is a value
between 0-127 that is the preload BRG value loaded into SSPADD. Bit 7 of the
mode byte is used to set/clear the SSPSTAT,SMP slew control bit.
I can't find anything on setting the SSPADD register in the Microchip datasheet.
The PICAXE values loaded for 'mode' are:
SLOW 167,147,137 for 16M, 8M and 4M
FAST 9, 4, 3 for 16M, 8M and 4M.

I need to try to get down to a 10khz rate to feed a particularly nasty part that stretches the clock. So 228/227 at 4MHz? Can't try it as I don't have the part yet.
 

hippy

Ex-Staff (retired)
SSPADD may be slightly differently named depending on the PICAXE / PICmicro. For the 08M2 it seems to be SSP1ADD. It may also be referred to as SSPxADD in the datasheet text.

The 12F1840 datsheet section on I2C baud rate shows -

Fclock = Fosc / ( SSPxADD+1 * 4 )

So for 4MHz operation, Fosc = 4MHz,

10,000 = 4,000,000 / ( SSPxADD-1 * 4 )

SSPxADD+1 * 4 = 4,000,000 / 10,000

SSPxADD+1 * 4 = 400

SSPxADD = ( 400 / 4 ) - 1

SSPxADD = 99
 
Top