ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 12.06.2025

Просмотров: 8319

Скачиваний: 1

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

© MCS Electronics, 1995-2007

resets this bit. So time is only set, if after second 58 a minute mark follows. Normally this bit is only at value 1 from Second 58 to second 60/00.

3This Bit indicates, that the DCF-Part should be stopped, if time is set. (at the option of updating once per hour or day).

4This Bit indicated that the DCF-Part is stopped.

5This bit indicates, that the CLOCK is configured the way, that during DCF-Clock is stopped, there is only one ISR-Call in one second.

6This Bit determines the level of the DCF input-pin at the pulse (100/200 mSec part).

7This bit indicates, that the DCF-Part has set the time of the Clock-part.

You can read the Status-Bit 7 (DCF_Status.7), to check whether the internal clock was synchronized by the DCF-Part. You can also reset this Bit with RESET DCF_Status.7. The DCF-Part will set this bit again, if a valid time-stamp is received.

You can read all other bits, but don’t change them.

The DCF-77 signal is broadcasted by the German Time and Frequency department. The following information is copied from : http://www.ptb.de/en/org/4/44/_index.htm

The main task of the department time and frequency is the realization and dissemination of the base unit time (second) and the dissemination of the legal time in the Federal Republic of Germany.

The second is defined as the duration of 9 192 631 770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium-133 atom.

For the realization and dissemination of the unit of time, the department develops and operates caesium atomic clocks as primary standards of time and frequency. In the past decades, these, as the worldwide most accurate atomic clocks, have contributed to the international atomic time scale (TAI) and represent the basis for the legal time in Germany. Dissemination of the legal time to the various users in industry, society, and research is performed via satellite, via a low frequency transmitter DCF77 and via an internetand telephone service.

The department participates in the tests for the future European satellite navigation system „Gallileo“.

Presently the primary clocks realizing the time unit are augmented by Cs clocks with laser cooled atoms („Cs-fountain clocks“) whose accuracy presently exceeds the clocks with thermal beams by a factor of 10 (frequency uncertainty of 1 . 10-15).

Future atomic clocks will most likely be based on atomic transitions in the optical range of single stored ions. Such standards are presently being developed along with the means to relate their optical frequencies without errors to radio-frequencies or 1 second pulsed.

As one may expect transitions in nuclei of atoms to be better shielded from environmental perturbations than electron-shell transitions which have been used so far as atomic clock references, the department attempts to use an optical transition in the nucleus of 229Th for a future generation of atomic clocks.

The work of the department is complemented by research in nonlinear optics (Solitons) and precision time transfer techniques, funded in the frame of several European projects and by national funding by Deutsche Forschungsgemeinschaft particularly in the frame of Sonderforschungsbereich 407 jointly with Hannover University.

The following information is copied from wikipedia : http://en.wikipedia.org/wiki/DCF77

page -334-


© MCS Electronics, 1995-2007

The signal can be received in this area:

DCF77 is a longwave time signal and standard-frequency radio station. Its primary and backup transmitter are located in Mainflingen, about 25 km south-east of Frankfurt, Germany. It is operated by T-Systems Media Broadcast, a subsidiary of Deutsche Telekom AG, on behalf of the Physikalisch-Technische Bundesanstalt, Germany's national physics laboratory. DCF77 has been in service as a standard-frequency station since 1959; date and time information was added in 1973.

The 77.5 kHz carrier signal is generated from local atomic clocks that are linked with the German master clocks in Braunschweig. With a relatively-high power of 50 kW, the station can be received in large parts of Europe, as far as 2000 km from Frankfurt. Its signal carries an amplitude-modulated, pulse-width coded 1 bit/s data signal. The same data signal is also phase modulated onto the carrier using a 511-bit long pseudorandomsequence (direct-sequence spread spectrum modulation). The transmitted data repeats each minute Map showing the range of the DCF77 signal.

Map showing the range of the DCF77 signal.

*the current date and time;

*a leap second warning bit;

*a summer time bit;

*a primary/backup transmitter identification bit;

*several parity bits.

Since 2003, 14 previously unused bits of the time code have been used for civil defence emergency signals. This is still an experimental service, aimed to replace one day the German network of civil defense sirens.

The callsign stands for D=Deutschland (Germany), C=long wave signal, F=Frankfurt, 77=frequency: 77.5 kHz. It is transmitted three times per hour in morse code.

Radio clocks have been very popular in Europe since the late 1980s and most of them use the DCF77 signal to set their time automatically.

For further reference see wikipedia, a great on line information resource.

The DCF library parameters state diagram looks as following:

page -335-

© MCS Electronics, 1995-2007

page -336-

© MCS Electronics, 1995-2007

See also

CONFIG DATE

ASM

_DCF77 from DCF77.LBX is included by the compiler when you use the CONFIG statement.

Example

$regfile = "M88def.dat" $crystal = 8000000

$hwstack = 128 $swstack = 128 $framesize = 128

$baud = 19200

'Config Dcf77 = Pind.2 , Debug = 1 , Inverted = 0 , Check = 2 , Update = 0 , Updatetime = 30 , Switchpower = 0 , Secondticks = 50 , Timer1sec = 1 , Powerlevel = 1 , Timer = 1

Config Dcf77 = Pind.2 , Timer = 1 , Timer1sec = 1 , Debug = 1

Enable Interrupts

Config Date = Dmy , Separator = .

Dim I As Integer

Dim Sec_old As Byte , Dcfsec_old As Byte

Sec_old = 99 : Dcfsec_old = 99

': DCF_Debug_Timer

= 0

' Testroutine für die DCF77 Clock

Print "Test DCF77 Version 1.00"

Do

For I = 1 To 78

Waitms 10

If Sec_old <> _sec Then

Exit For End If

If Dcfsec_old <> Dcf_sec Then

Exit For End If

Next Waitms 220

Sec_old = _sec Dcfsec_old = Dcf_sec

Print Time$ ; " " ; Date$ ; " " ; Time(dcf_sec) ; " " ; Date(dcf_day) ; " " ; Bin(dcf_status) ; " " ; Bin(dcf_bits) ; " " ; Bdcf_impuls ; " " ; Bdcf_pause

Loop

End

CONFIG DATE

page -337-


© MCS Electronics, 1995-2007

Action

Configures the delay time for the DEBOUNCE statement.

Syntax

CONFIG DEBOUNCE = time

Remarks

Time

A numeric constant which specifies the delay time in mS.

When debounce time is not configured, 25 mS will be used as a default.

See also

DEBOUNCE

Example

'-----------------------------------------------------------------------------

------------

: deboun.bas

'name

'copyright

: (c) 1995-2005, MCS Electronics

'purpose

: demonstrates DEBOUNCE

'micro

: Mega48

'suited for demo

: yes

'commercial addon needed

: no

'-----------------------------------------------------------------------------

------------

$regfile = "m48def.dat"

' specify the used

micro

' used crystal

$crystal = 4000000

frequency

' use baud rate

$baud = 19200

$hwstack = 32

' default use 32

for the hardware stack

' default use 10

$swstack = 10

for the SW stack

' default use 40

$framesize = 40

for the frame space

Config Debounce = 30

'when the config

statement is not used a default of 25mS will be used

'Debounce Pind.0 , 1 , Pr 'try this for branching when high(1)

Debounce Pind.0 ,

0

, Pr , Sub

Debounce Pind.0 ,

0

, Pr , Sub

'

^

^-----

label to branch to

'

^

Branch when P1.0 goes low(0)

'

Examine P1.0

'When Pind.0 goes low jump to subroutine Pr 'Pind.0 must go high again before it jumps again 'to the label Pr when Pind.0 is low

Debounce

Pind.0

,

1

,

Pr

'no branch

Debounce

Pind.0

,

1

,

Pr

'will result in a

return without gosub

End

page -338-


© MCS Electronics, 1995-2007

Pr:

Print "PIND.0 was/is low"

Return

CONFIG I2CDELAY

Action

Compiler directive that overrides the internal I2C delay routine.

Syntax

CONFIG I2CDELAY = value

Remarks

value

A numeric value in the range from 1 to 255.

A higher value means a slower I2C clock.

For the I2C routines the clock rate is calculated depending on the used crystal. In order to make it work for all I2C devices the slow mode is used. When you have faster I2C devices you can specify a low value.

By default a value of 5 is used. This will give a 200 kHZ clock.

When you specify 10, 10 uS will be used resulting in a 100 KHz clock.

When you use a very low crystal frequency, it is not possible to work with high clock frequencies.

ASM

The I2C routines are located in the i2c.lib/i2c.lbx files.

For chips that have hardware TWI, you can use the MasterTWI lib.

See also

CONFIG SCL , CONFIG SDA

Example

'-----------------------------------------------------------------------------

------------

: i2c.bas

'name

'copyright

: (c) 1995-2005, MCS Electronics

'purpose

: demo: I2CSEND and I2CRECEIVE

'micro

: Mega48

'suited for demo

: yes

'commercial addon needed

: no

'-----------------------------------------------------------------------------

------------

$regfile = "m48def.dat"

' specify the used

micro

' used crystal

$crystal = 4000000

frequency

page -339-