2.5 Baud Rate Generator
The MSSP module has a Baud Rate Generator available for clock generation in both I2C and SPI Master modes. The Baud Rate Generator (BRG) reload value is placed in the SSPxADD register. When a write occurs to SSPxBUF, the Baud Rate Generator will automatically begin counting down. Equation 2-1 shows how the value for SSPxADD is calculated.
Once the given operation is complete, the internal clock will automatically stop counting and the clock pin will remain in its last state.
An internal signal “Reload”, shown in Figure 2-13, triggers the value from SSPxADD to be loaded into the BRG counter. This occurs twice for each oscillation of the module clock line. The logic dictating when the reload signal is asserted depends on the mode in which the MSSP is being operated.
Table 2-1 illustrates clock rates based on instruction cycles and the BRG value loaded into SSPxADD.
FOSC | FCY | BRG Value | FCLOCK (2 Rollovers of BRG) |
---|---|---|---|
32 MHz | 8 MHz | 13h | 400 kHz |
32 MHz | 8 MHz | 19h | 308 kHz |
32 MHz | 8 MHz | 4Fh | 100 kHz |
16 MHz | 4 MHz | 09h | 400 kHz |
16 MHz | 4 MHz | 0Ch | 308 kHz |
16 MHz | 4 MHz | 27h | 100 kHz |
4 MHz | 1 MHz | 09h | 100 kHz |
Note: Refer to the
“Electrical Specifications” chapter of the data sheet, to ensure
the system is designed to support all requirements.
|