mirror of
https://github.com/Matiasus/SSD1306.git
synced 2024-10-03 18:18:46 -04:00
Update freq for m328p
This commit is contained in:
parent
1fd118cf4f
commit
38317fe3c9
@ -31,17 +31,20 @@ void TWI_Init (void)
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++
|
||||
// Calculation fclk:
|
||||
//
|
||||
// fclk = (fcpu)/(16+2*TWBR*4^Prescaler)
|
||||
// fclk = (fcpu)/(16+2*TWBR*4^Prescaler) m16
|
||||
// fclk = (fcpu)/(16+2*TWBR*Prescaler) m328p
|
||||
// ---------------------------------------------
|
||||
// Calculation TWBR:
|
||||
//
|
||||
// TWBR = {(fcpu/fclk) - 16 } / (2*4^Prescaler)
|
||||
// +++++++++++++++++++++++++++++++++++++++++++++
|
||||
// @param1 value of TWBR,
|
||||
// @param1 value of TWBR (m16)
|
||||
// fclk = 400kHz (m16); TWBR = 3
|
||||
// fclk = 100kHz (m16); TWBR = 20
|
||||
// @param1 value of TWBR (m328p)
|
||||
// fclk = 400kHz (m16); TWBR = 2
|
||||
// @param2 value of Prescaler = 1
|
||||
TWI_FREQ (3, 1);
|
||||
TWI_FREQ (2, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user