uses the LCD include software as shown here to drive the LCD, and
has an additional seconds counter and display that simply counts from 0 to 59.
The device can be used as a complete display for all DCF77 receivers as described on that webpage,
providing time and date from the receiver as well as status and error messages.
6.1 Connecting the device with the receiver
With a six pin flat cable, both sides equipped with a plug, connect
pin 1 with GND (minus operating voltage),
pin 2 with +5 V operating voltage,
pin 3 with the serial clock pin of the ATtiny45 controller (SCM), and
pin 6 with the serial data pin of the ATtiny45 (SDM).
See the schematic of the Tiny24-LCD experimental display device
All you need to do is programming the ATtiny24's flash memory with the software provided
When starting and without any serial input signals the program starts like this.
In line 2 behind Raw data: the incoming raw data is displayed. The first
character (MSB in rRxH) is simple ASCII, then rRxL follows in
hexadecimal format. If the displayed first character is an F: then the
PWM value of the frquency adjustment follows as a three-digit decimal.
The incoming DCF77 data for the time (hours and minutes) follow in line 3. The
seconds display is internally generated and counts even without DCF77 signal.
Behind the ASCII character S: the PWM value of the gain adjustment
follows in 3-digit decimal format.
Line 4 displays the weekday and the date, with format depending from the language
chosen, and any signal errors behind E:.
The display changes when the ATtiny45's SCM and SDM are connected.
The software can be downloaded as assembler source code from
here or can be displayed in the web-browser
The following chapters describe the software's functions further.
6.3.1 Receptiion of the serial signals
Serial reception works as follows:
On each level change on the PA0 input pin (SCM signal) a PCINT0 interrupt
If the PA0 pin is high, following level change, a bit on the data input pin
PA1 has to be shifted into the register pair for serial signals
(rSerialH:rSerialL), starting from bit 0 (rotate left). The number of
received bits is down-counted from 16, if it reaches zero the content of the
serial registers is copied to the register pair rRxH:rRxL, the flag
bRxIn is set and the counter restarts with 16. Any bit reception sets
the time-out counter rSerialTO to its start value.
Outside the PCINT0 routine the time-out-counter is counted down. If it
reaches zero, the counter of still-to-be-received-bits is restarted at 16.
The further handling of the 16 bits received in rRxH:rRxL is performed
outside the Interrupt-Service-Routine. Depending from the MSB in rRxH
the lower 8 bits in rRxL are handled differently. The modes are part
of a table PosTable::
Each line of the table starts with the respective ASCII character.
The two following bytes are the line and the column where information
on the LCD will be displayed (zero-based numbers).
If the parameter concerns a DCF77 info, its displacement in SRAM follows
as a byte. If not, 255 follows.
The type of displaying the parameter follows as byte. A zero simply
displays the parameter as ASCII character. A 1 displays as a 2-digit
decimal, a 2 as 3-digit decimal. A 3 displays as a weekday (zero-based)
and a 4
shifts the received zero or one into a register buffer, and
displays the last four received bits as binary ASCII characters.
The closing zero in each line brings the byte count to an even number of
The table ends ends with two zeroes.
Extending the ATtiny45 controller software with further parameters can simply
be added to this table. The structure can also be used with other controllers.
6.3.2 Seconds and serial interface time-out
For generating the seconds the timer TC0 is used. It divides the clock signal
of 1 MHz (default clock rate) with a prescaler value of 8 and by 125,
which yields a 1 ms time interrupt. The interrupt counts down a counter
in register pair rSecH:rSecL that starts with 1,000. If the counter
reaches zero, the flag bSec is set and the register pair is restarted
If the seconds flag is set, the seconds are advanced and displayed at the
respective position on the LCD. If the seconds reach 60, the seconds counter
The milli second interrupt also decreases the time-out value. If, after 8 ms,
this reaches zero the number of bits-to-be-received restarts with 16.
6.3.3 Debugging option
This option, if the debug switch Debug_display is set to Yes,
simulates the reception of serial signals. The bit combination in
the constant cDebug_displayH and cDebug_displayL
is tested. The debug switch has to be set to No to assemble the final
version of the software.