Sign in

username:

password:



Not a member?

Search avrclub



Search tips

Subscribe to avrclub



avrclub by Keywords

AT90S2313 | AT90S8515 | ATMega | ATmega128 | ECL | FETS | IAR | Keyboard | LCD | STK50 | TMOS | UART


Ads

Discussion Groups

See Also

DSPFPGAElectronics

Discussion Groups | AVRclub | [AVR club] =?iso-8859-1?Q?I_cracked_the_magic_TWI_=28I=B2C=29_formula_?=


Advertise Here

Atmel AVR Microcontroller discussion group.

[AVR club] =?iso-8859-1?Q?I_cracked_the_magic_TWI_=28I=B2C=29_formula_?= - Eric - Jul 9 4:24:15 2009

I cracked the magic TWI (Two Wire Interface) (I²C) formula for calculating
the clock frequency

Given in the data sheets as
SCL frequency=CPU Clock Frequency/16+2*(TWBR).4^(TWPS)
I have wonder why is there a dot between the (TWBR) and the 4
why make thing easy when you can make them hard?
For a moment I thought the dot was a Boolean AND

the truth is the dot should be replaced with a * (or multiple)

after trying backets in differant places like
SCL frequency=CPU Clock Frequency/16+(2*(TWBR))*4^(TWPS)
and a few other combinations

this is the correct formula below
SCL frequency=CPU Clock Frequency/(16+(2*(TWBR))*4^(TWPS))
you can even get your spreedsheet to work it out

A quick tutorial from http://www.mathsnet.net/a2zofssheets.html
and what more could you ask for?

>From Eric

------------------------------------

______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.


(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )