DCF77 receiving and decoding implementation. More...
Go to the source code of this file.
Functions | |
| void | interruptDcf () |
| Time the DCF77 pulses gets called from pin interrupt port1ISR(void) | |
| unsigned int | calculateBitTransmitTime (bool checkSyncStatus, unsigned int start, bool startDir, unsigned int stop, bool stopDir) |
| Calculate the bit time of the DCF77 pulses, gets called from interruptDcf() | |
| bool | bitValue (unsigned int bitTime) |
| Determine the bit value of the transmitted DCF77 bit and return it, gets called from interruptDcf() | |
| void | storeBit (bool bit, unsigned int location) |
| Store the received DCF77 bit in the array, gets called from interruptDcf() | |
| bool | checkBitStream () |
| Checks if certain predetermined bits are 1 or 0 and if parity of minute and hour is correct, gets called from interruptDcf() | |
| void | decodeBitStream2Seconds () |
| Decode the received DCF77 bitstream to a time, gets called from interruptDcf() Also ensure that the received time is plausible by a couple of checks. | |
Variables | |
| unsigned int | testbitTimeCyclesStart = bitTimeCyclesSync |
| unsigned int | testbitTimeCyclesStartUpper = bitTimeCyclesSyncUpper |
| unsigned int | testbitTimeCyclesStartLower = bitTimeCyclesSyncLower |
DCF77 receiving and decoding implementation.
Definition in file dcfReceive.c.
| bool bitValue | ( | unsigned int | bitTime | ) |
Determine the bit value of the transmitted DCF77 bit and return it, gets called from interruptDcf()
| bitTime | Time of the bit signal in timer cycles |
Definition at line 154 of file dcfReceive.c.
References bitTimeCycles0Lower, bitTimeCycles0Upper, bitTimeCycles1Lower, and bitTimeCycles1Upper.
Referenced by interruptDcf().
| unsigned int calculateBitTransmitTime | ( | bool | checkSyncStatus, |
| unsigned int | start, | ||
| bool | startDir, | ||
| unsigned int | stop, | ||
| bool | stopDir ) |
Calculate the bit time of the DCF77 pulses, gets called from interruptDcf()
Calculate the time it took between the rising and falling edge of the DCF77 pulse Take in to account the up and down behavior of the timer
| checkSyncStatus | (unused in this function). |
| start | The start point of the transmission on the timer up/down counter. |
| startDir | The direction of the start point (1 for up, 0 for down). |
| stop | The stop point of the transmission. |
| stopDir | The direction of the stop point (1 for up, 0 for down). |
Definition at line 120 of file dcfReceive.c.
References capacityTimer.
Referenced by interruptDcf().
| bool checkBitStream | ( | ) |
Checks if certain predetermined bits are 1 or 0 and if parity of minute and hour is correct, gets called from interruptDcf()
Definition at line 188 of file dcfReceive.c.
References bitArray, UART_Bitstream(), and UART_SendString().
Referenced by interruptDcf().
| void decodeBitStream2Seconds | ( | ) |
Decode the received DCF77 bitstream to a time, gets called from interruptDcf() Also ensure that the received time is plausible by a couple of checks.
Definition at line 262 of file dcfReceive.c.
References bitArray, countDcf77Messages, hourDcfLast, mechanicalTimeFloat, minuteDcfLast, timeOfLastDcfMessage, timeSinceLastCompleteDcfMessage, UART_Bitstream(), UART_SendInt(), UART_SendString(), and UART_SendTime().
Referenced by interruptDcf().
| void interruptDcf | ( | ) |
Time the DCF77 pulses gets called from pin interrupt port1ISR(void)
Wait first for sync pulse than read out each of 59 bits Determine the value of the bit with: bool bitValue() based on the calculated transmit time with: unsigned int calculateBitTransmitTime() Store the result via: storeBit(), when all 59 bits are received check with: checkBitStream(), and decode to time: decodeBitStream2Seconds()
Definition at line 26 of file dcfReceive.c.
References bitArrayLength, bitValue(), calculateBitTransmitTime(), checkBitStream(), countingDirectionEnd, countingDirectionStart, currentBit, decodeBitStream2Seconds(), endTime, interruptEdgeToggleDcf, startTime, storeBit(), testbitTimeCyclesStartLower, testbitTimeCyclesStartUpper, toggleTimer1Direction, and UART_SendString().
Referenced by port1ISR().
| void storeBit | ( | bool | bit, |
| unsigned int | location ) |
Store the received DCF77 bit in the array, gets called from interruptDcf()
| [in] | bit | The value of the bit |
| [in] | location | The location of the array to store the bit |
Definition at line 178 of file dcfReceive.c.
References bitArray.
Referenced by interruptDcf().
| unsigned int testbitTimeCyclesStart = bitTimeCyclesSync |
Definition at line 15 of file dcfReceive.c.
| unsigned int testbitTimeCyclesStartLower = bitTimeCyclesSyncLower |
Definition at line 17 of file dcfReceive.c.
Referenced by interruptDcf().
| unsigned int testbitTimeCyclesStartUpper = bitTimeCyclesSyncUpper |
Definition at line 16 of file dcfReceive.c.
Referenced by interruptDcf().