Path: Home => AVR overview => Applications => DCF77 receivers => DCF77 display of serial signals
DCF77 receiver logo Applications of
AVR single chip controllers AT90S, ATtiny, ATmega und ATxmega
DCF77 display of serial signals
Logo

6 DCF77 display with an ATtiny24

The display as serial receiver This device
  1. receives the serial signals from an ATtiny45 decoder and displays those on an LCD,
  2. is working with the ATtiny24 experimental device with LCD and can be attached using a simple six pin plug,
  3. uses the LCD include software as shown here to drive the LCD, and
  4. 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
  1. pin 1 with GND (minus operating voltage),
  2. pin 2 with +5 V operating voltage,
  3. pin 3 with the serial clock pin of the ATtiny45 controller (SCM), and
  4. pin 6 with the serial data pin of the ATtiny45 (SDM).
See the schematic of the Tiny24-LCD experimental display device here. All you need to do is programming the ATtiny24's flash memory with the software provided here.

6.2 Display

Display on start-up 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.

6.3 Software for the ATtiny24

The software can be downloaded as assembler source code from here or can be displayed in the web-browser here.

The following chapters describe the software's functions further.

6.3.1 Receptiion of the serial signals

Serial reception works as follows:
  1. On each level change on the PA0 input pin (SCM signal) a PCINT0 interrupt is executed.
  2. 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.
  3. 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::
  1. Each line of the table starts with the respective ASCII character.
  2. The two following bytes are the line and the column where information on the LCD will be displayed (zero-based numbers).
  3. If the parameter concerns a DCF77 info, its displacement in SRAM follows as a byte. If not, 255 follows.
  4. 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
  5. The closing zero in each line brings the byte count to an even number of bytes.
  6. 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 with 1,000.

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 restarts.

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.

©2019 by http://www.avr-asm-tutorial.net