Ds1307
Newzed
Posts: 2,503
My program for the DS1307 calls for the entering of the time/date parameters as decimals, then converting the decimals to BCD before I2COUT, and converting the BCD to decimals after I2CIN.
If I enter the time/date parameters in a HEX2 format, can I eliminate the decimal/BCD and the BCD/decimal conversion process?
Sid
If I enter the time/date parameters in a HEX2 format, can I eliminate the decimal/BCD and the BCD/decimal conversion process?
Sid
Comments
· hexVal = (decVal / 10 << 4) + (decVal // 10)
· decVal = (hexVal.NIB1 * 10) + hexVal.NIB0
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Did you look at this month's project of the month? http://www.awce.com/som.htm
Al Williams
AWC
Sid
thanks, bward
In the future you can answer your own question by using the resources of this handy search engine: http://www.findchips.com/ . Presently Mouser, Digikey, and a number of other supplier are showing stock. You can also purchase or ask for samples of, any of the Maxim/Dallas Semiconductor parts right from their web site: http://www.maxim-ic.com/ .
They have always been quite generous with their sample policy.
Regards,
Bruce Bates