PCFRTC LOCAL PCFRTC
NAME
pcfrtc -- Driver for NPX PCF8583 Real-Time Clock and Calendar/Counter/240 x 8bit RAM via I2C bus
SYNOPSIS
pcfrtc* at iic? addr 0x50 pcfrtc* at iic? addr 0x50 flags x pcfrtc* at iic? addr 0x51 pcfrtc* at iic? addr 0x51 flags x
DESCRIPTION
The pcfrtc driver supports the PCF8583 multifunction chip which can oper- ate in one of four modes depending on the value of the flag [if speci- fied]: mode 0 - Clock & Calendar using a 32768 hz crystal. This is the default mode in the absence of a flags field and is the state when a power-on reset occurs. mode 1 - Clock & Calendar using external 50 Hz clock. Similar to mode 0, but relies on an external clock source rather than a crystal. mode 2 - Counter for external inputs. The clock & calendar are disabled and the device counts external events using a 3 byte bcd counter [0-999999]. mode 3 - Test mode. This is undocumented and unlikely to be useful. The pcfrtc driver is commonly used to support a real-time clock using a 32768 hz crystal and a backup battery. It also provides a small amount of battery backed RAM which is used, for example, for bootstrapping acorn32 system. It is possible to use an external 50hz clock by switch- ing to mode 1 -- this might be useful with a European mains derived sig- nal as the long term drift is likely to be less than an unstabilised crystal. Access methods to retrieve and set date and time are provided through the TODR interface defined in todr(9). Switching to mode 2 provides access to a 6 digit BCD counter, which can be used to count arbitary external events. The driver maps this counter to an integer envstat variable, which can be read via the normal envstat subsystem, and also exposes a sysctl variable to allow the counter to be reset.
SYSCTL VARIABLES
In mode 2 the following sysctl(3) variables are provided: hw.pcfrtc1.counter_reset If this is set to 1 then the next read of the envstat counter causes the BCD counter to be zeroed and resets the sysctl vari- able back to zero.
SEE ALSO
todr(9), envstat(8), sysctl(8)
HISTORY
The pcfrtc driver first appeared in NetBSD 1.0.
AUTHORS
The pcfrtc driver was written by Steve C. Woodford and Jason R. Thorpe for Wasabi Systems, Inc. based on Ben Harris's PCF8583 driver for NetBSD/acorn26. Subsequent modifications to support other modes by Dave Tyson <dtyson@anduin.org.uk>
BUGS
The driver does not support the chip's alarm and timer features. NetBSD 11.99 October 1, 2026 NetBSD 11.99
Powered by man-cgi (2026-09-02). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.