Welcome Guest, you are in: Login

Fruit Of The Shed

Navigation (MMBasic)






Search the wiki

»


Page History: Temperature Measurement with DS3231 Realtime Clock RTC

Compare Page Revisions



« Older Revision - Back to Page History - Current Revision


Page Revision: 2017/05/03 07:28


The DS3231 RTC chip has a temperature measurement junction which is automatically sampled every 64 seconds. The measurement is placed in registers 17 & 18. Register 17 contains whole degrees and 18 the fraction if you want it (this fraction is binary point, not decimal point so MSB is 0.5d, next is 0.25d etc.).

This can be useful for measuring the (ambient) temperature of an enclosure.

Assuming whole degrees only:

Code:
  RTC GetReg 17,x   ' read the whole degrees only

  t=x AND &h7f      ' mask off the sign