![Digi Rabbit 5000 Скачать руководство пользователя страница 49](http://html1.mh-extra.com/html/digi/rabbit-5000/rabbit-5000_user-manual_2496192049.webp)
Chapter 4 System Management
49
4.3 Operation
4.3.1 Periodic Interrupt
The following steps explain how a periodic interrupt is used.
1. Write the vector to the interrupt service routine to the internal interrupt table.
2. Enable the periodic interrupt by writing to GCSR.
3. The interrupt request is cleared by reading from GCSR.
A sample interrupt handler is shown below.
periodic_isr::
push af
ioi ld a, (GCSR) ; clear the interrupt request and get status
; handle any periodic tasks here
pop af
ipres
ret
4.3.2 Real-Time Clock
The real-time clock consists of six 8-bit registers that together comprise a 48-bit value.
The real-time clock is not synchronized to the read operation, so the least-significant bit
should be read twice and checked for matching values; if the two reads do not match, then
the real-time clock may have been updating during the read and should be read again.
Writing to RTC0R latches the current real-time clock value into the RTCxR holding regis-
ters, so the following sequence should be used to read the real-time clock.
1. Write any value to RTC0R and then read back a value from RTC0R.
2. Write a value to RTC0R again, and again read back a value from RTC0R.
3. If the two values do not match, repeat Step 2 until the last two readings are identical.
4. At this point, registers RTC1R through RTC6R can also be read and used.
Note that the periodic interrupt and the real-time clock are clocked by the same edge of the
32 kHz clock; if read from the periodic interrupt, the count is guaranteed to be stable and
only needs to be read once (assuming it occurs within one clock of the 32 kHz clock).
The real-time clock can be reset by writing the sequence 0x40 – 0x80 to RTCCR. It can be
reset and left in the byte increment mode by writing 0x40 – 0xC0 to RTCCR and then
writing bytes repeatedly to RTCCR to increment the appropriate bytes of the real-time
clock. The byte increment mode is disabled by writing 0x00 to RTCCR.
Содержание Rabbit 5000
Страница 1: ...Rabbit 5000 Microprocessor User s Manual 019 0168_E...
Страница 11: ...Table of Contents Appendix B Rabbit 5000 Errata 401 B 1 Errata 401 Index 405...
Страница 12: ...Rabbit 5000 Microprocessor User s Manual...
Страница 20: ...20 Rabbit 5000 Microprocessor User s Manual...
Страница 36: ...36 Rabbit 5000 Microprocessor User s Manual...
Страница 56: ...56 Rabbit 5000 Microprocessor User s Manual...
Страница 92: ...92 Rabbit 5000 Microprocessor User s Manual...
Страница 104: ...104 Rabbit 5000 Microprocessor User s Manual...
Страница 122: ...122 Rabbit 4000 Microprocessor User s Manual...
Страница 142: ...142 Rabbit 5000 Microprocessor User s Manual...
Страница 214: ...214 Rabbit 5000 Microprocessor User s Manual...
Страница 228: ...228 Rabbit 5000 Microprocessor User s Manual...
Страница 280: ...280 Rabbit 5000 Microprocessor User s Manual...
Страница 298: ...298 Rabbit 5000 Microprocessor User s Manual...
Страница 306: ...306 Rabbit 5000 Microprocessor User s Manual...
Страница 314: ...314 Rabbit 5000 Microprocessor User s Manual...
Страница 368: ...368 Rabbit 5000 Microprocessor User s Manual...
Страница 388: ...388 Rabbit 5000 Microprocessor User s Manual...
Страница 396: ...396 Rabbit 5000 Microprocessor User s Manual...
Страница 404: ...404 Rabbit 5000 Microprocessor User s Manual...