Update freq for m328p

This commit is contained in:
matiasus 2022-12-11 14:18:14 +01:00
parent 1fd118cf4f
commit 38317fe3c9

View File

@ -31,17 +31,20 @@ void TWI_Init (void)
// +++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++
// Calculation fclk: // 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: // Calculation TWBR:
// //
// TWBR = {(fcpu/fclk) - 16 } / (2*4^Prescaler) // TWBR = {(fcpu/fclk) - 16 } / (2*4^Prescaler)
// +++++++++++++++++++++++++++++++++++++++++++++ // +++++++++++++++++++++++++++++++++++++++++++++
// @param1 value of TWBR, // @param1 value of TWBR (m16)
// fclk = 400kHz (m16); TWBR = 3 // fclk = 400kHz (m16); TWBR = 3
// fclk = 100kHz (m16); TWBR = 20 // fclk = 100kHz (m16); TWBR = 20
// @param1 value of TWBR (m328p)
// fclk = 400kHz (m16); TWBR = 2
// @param2 value of Prescaler = 1 // @param2 value of Prescaler = 1
TWI_FREQ (3, 1); TWI_FREQ (2, 1);
} }
/** /**