On Thu, 17 Jan 2002, Byron A Jeff wrote: > > Don't trust the tables. > > I never have. For all things relating to the PIC USART I use Fr. Thomas > McGahee's highly annotated code the describes the operation of the USART, > including the formula for bit rate generation. It's an invaluable resource > for dealing with the USART and includes many 'gotchas' that have been learned > from hard experience. Check it out here: > > http://mcgahee.freeservers.com > Agree. However I don't found any diferences between standard formulas: spbrg = (xtal[hz]/(baudrate[bps]*64))-1 for brgh=low spbrg = (xtal[hz]/(baudrate[bps]*16))-1 for brgh=high and rounded formulas: spbrg_value = (((d'10'*XTAL_FREQ/(d'16'*baudrate))+d'5')/d'10')-1 spbrg_value = (((d'10'*XTAL_FREQ/(d'64'*baudrate))+d'5')/d'10')-1 the result is +/- 1 diference in spbrg value which means almost nothing, my test shows that at many baud rates even with +/- 3 from computed spbrg values does not affect asynchronous communications ( not applicable with small spbrgh ) Of course the computed error must be smallest as possible. So my question: do you found any situation when rounded formulas must be applied ? regards, Vasile -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads