18.11.2014 Views

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

The Microcontroller Idea Book - Jan Axelson's Lakeview Research

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 10<br />

To generate an interrupt at a specific time, you select an alarm frequency by setting or<br />

clearing three mask bits (bit 7 of registers 3, 5, and 7), and storing the desired alarm data in<br />

bits 0-6 of the same registers. Clearing a register’s mask bit means that the DS1286 will use<br />

values in that register to determine the alarm frequency. Setting a mask bit means that the<br />

DS1286 will ignore the information in the register. For example, to generate an interrupt at<br />

3:15 daily, you would store the following values:<br />

Register Mask Byte Alarm Data<br />

3 0001 0101 15 minutes<br />

5 0000 0011 3 hours<br />

7 1XXX XXXX days (X=don’t care)<br />

Table 10-3. Decimal numbers and their equivalents in binary and<br />

binary-coded decimal. <strong>The</strong> values 0-9 are identical in BCD and binary.<br />

Decimal Binary-coded Decimal (BCD) Binary<br />

0 0000 0000 0000 0000<br />

1 0000 0001 0000 0001<br />

2 0000 0010 0000 0010<br />

3 0000 0011 0000 0011<br />

4 0000 0100 0000 0100<br />

5 0000 0101 0000 0101<br />

6 0000 0110 0000 0110<br />

7 0000 0111 0000 0111<br />

8 0000 1000 0000 1000<br />

9 0000 1001 0000 1001<br />

10 0001 0000 0000 1010<br />

11 0001 0001 0000 1011<br />

19 0001 1001 0001 0011<br />

20 0010 0000 0001 0100<br />

29 0010 1001 0001 1101<br />

30 0011 0000 0001 1110<br />

99 1001 1001 0110 0011<br />

178 <strong>The</strong> <strong>Microcontroller</strong> <strong>Idea</strong> <strong>Book</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!