|
BV4236 |
Real Time Clock & Temperature Sensor |
Datasheet RTC
Temp |
£11.70 |
 |
The BV4236 is a small circuit board that
contains a M41T81 Real Time Clock with alarms and also an
MCP9802 High Accuracy Temperature Sensor |
Sold out, see BV4237
|
|
|
|
|
This board is basically a carrier for the two IC's that make up the
Real Time Clock (RTC), M41T81 and the Digital Temperature Sensor,
MCP9802. I conveniently combines the two for applications that require
RTC or temperature sensing. A particularly useful feature of this RTC is
that it can detect power down and record the time at that event.
The data sheet should be read in conjunction with the RTC and
Temperature Sensor data sheets which are available on this site.
Features RTC
- I2C up to 400kHz
- Detects power down and saves time
- Battery back up
- Programmable Alarm
- Watchdog timer
- RTO Output
Features Temperature Sensor
- 12 bit resolution
- Operating Current 1uA
- Power saving mode
- -55 C to +125 C
- Alert output
Electrical Specification
The board has 4 pins for the I2C interface along with two
connections, one for the RTO output from the RTC and the other for the
temperature alert output of the temperature sensor.
This latter connection has a 5k5 pull up resistor on board the user must
provide the other resistor if required for the RTO output. The RTC clock
has its own 32kHz crystal and there is a battery holder to take a
standard CR1220 lithium battery.

Circuit Diagram
As can be seen the circuit diagram is very straightforward. R1 and R2
are the I2C pull up resistors and are NOT populated on the standard
BV4236 board.

Examples
The following examples are using the BV4221,
USB to I2C convertor to drive the BV4236 in this arrangement:

Temperature Sensor
The temperature sensor address is 0x90 and has 4 writeable addresses
0-3 that control how it works.
For this example the default setting of 9 bit resolution is taken. To
read the temperature write 0 first thus:
0x90>s 0 r g-2 p
The above, first writes 0 which selects the temperature register and
then it reads from address 0x91 two bytes.
The temperature will be displayed in hex.

The first reading shows a temperature of 0x16 (22 C) and the second
reading, after warming the IC with the fingers reads 27.5 C.
The 0x1b is 27 and the 0x80 is 0.5, this is the default 9bit resolution,
the 9th bit is either 0.0 or 0.5 degrees.
Real Time Clock
The RTC needs a battery to operate and this should be fitted to the
battery holder provided. The + sign points away from the PCB. The RTC
address is 0xD0
It is very easy to read and write as it has a set of registers that can
be addressed in a similar way to a memory location.
The registers are allocated as follows:
1. Tenths/Hundredths of a Second Register
2. Seconds Register
3. Minutes Register
4. Century/Hours Register
5. Day Register
6. Date Register
7. Month Register
8. Year Register
9. Control Register
10. Watchdog Register
11 - 16. Alarm Registers
17 - 19. Reserved
20. Square Wave Register
To set the time to 15:10 for example:
0xD0>s 0 0 0 10 15 p
The first 0, addresses the ‘timekeeper’ register to point to the
Tenths/Hundredths of a second register. The following ‘0 0 10 15’ write
to the consecutive registers. To read back the time including the
Tenths/Hundredths of a second, address 0 again as follows.
0xD0>s 0 r g-4 p
Read the first four bytes for the ‘timekeeper’ register. To just read
the minutes and seconds, address the second byte of the register before
reading.
0xD0>s 2 r g-2 p
An example of this is given in the screen shot below.
When power is removed form the RTC it will retain the current time and
this can be read using the above. The clock will appear to have stopped
until the HT flag is cleared, this must be done for each power down/up
cycle.
0xD0>s c 0 p (clearing the HT Flag)

The above are just some simple pointers to getting the RTC going. The
IC is a very comprehensive timekeeper. To get the best form it this must
be read in conjunction with the appropriate datasheet.
|