Skip to content

Commit 1b3c750

Browse files
author
simon
committed
Adding theory of operation documentation section to main README.md.
1 parent e6807bc commit 1b3c750

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,24 @@ STM32F2 | | | X |
4747
* ATtiny85 @ 8MHz : Adafruit Gemma, Arduino Gemma, Adafruit Trinket 3V
4848

4949
<!-- END COMPATIBILITY TABLE -->
50+
51+
### PCF8523 Timers
52+
#### Timer Theory of Operation
53+
54+
A timer counts down from some value, with some frequency (see the enumeration Pcf8523FrequencyDivision) associated with its counting operation. A timer counts out the period PERIOD = TIMER_VALUE / TIMER_FREQUENCY from the time it is enabled. When disabled, a timer is cleared, rather than paused.
55+
56+
The PCF8523 has three timers. Countdown timers A and B count down to 0, and then start over counting from their original value. When a timer's value reaches 0, its flag is set. If its interrupt is enabled, timer A sets the INT1 pin, and timer B sets the INT1 and INT2 pins. These pins remain set until the interrupt flag is cleared, or until the interrupt is disabled.
57+
58+
Watchdog timer A counts down from some value, but does not begin counting again when zero is reached. The interrupt flag/enable facilities are the same. Unlike the countdown timers, the flag is automatically cleared on the next read of the flag and interrupt control register (control 2); reading the timer state, the interrupt state, or writing the interrupt state will accomplish this register-clearing read as a side-effect. Note that WDT A is a mode of timer A, and it cannot be run concurrently with countdown timer A.
59+
60+
The INT1 line is shared with the CLKOUT/square wave function. Only one function can be used, and enabling the interrupt output will disable the square wave generation function.
61+
62+
#### Wiring and Configuring the Interrupt Lines
63+
64+
The INT1 and INT2 pins are open collectors, and transition from high-impedance to low-impedance when an interrupt becomes active. When an INT pin is connected to a pulled-up GPIO pin, the GPIO pin's digital state will be low when the interrupt is active.
65+
66+
#### Notes on Pinouts and Form-factors
67+
68+
INT1 is available on Adafruit's feather and standalone boards for the pcf, as "INT" on the feather (https://www.adafruit.com/product/2922) and "SQW" on the standalone board (https://www.adafruit.com/product/3295).
69+
70+
INT2 is available only in the TSSOP14 form-factor of the pcf.

0 commit comments

Comments
 (0)