Download RPC-220 USER`S MANUAL REV 1
Transcript
REAL TIME CLOCK SECTION 7 freque ncy, refer to Table 2 in th e DS168 9-93. PDF file for the proper value to write to RS0-RS3. without having to reprogram the flash every time. One potential downside is CPU I/O ports (and registers) are changed after a reset. R unning a program through interr upts does not ac count for a reset. IDLE This mode uses more pow er (about 10 ma) but lets you wake up on an interrupt and continue execution. Essentially, this is the same as interrupt mode described under "RTC INTERRUPTS" below. INTERRUPTS The RTC is can generate an interrupt due to several conditions. These are described on page 7 of the DS1689-93.PD F file. Three of the conditions (kick start, RAM clear, and wake up) are effectively disabled on the RPC-220. This leaves you with periodic, alarm (specific date and time), and update interr upts. Two of the interrupts, periodic and alarm, are described in application programs RTC -1.C and RTC-2. C in the RTC subdirector y. To use the interrupts, jumper J3[2325]. This brings the interrupt from the clock to CPU interrupt INT1. The RTC can generate periodic interrupts every month, day, hour, minute, and second. It can also generate an interrupt on a specific day, hour, minute, and/ or second by simply progr amming the a ppropriate alar m register s. Another periodic interrupt, using the square wave output, is describe d next. SQUARE WAVE OUTPUT The RTC can output a square wave at J3-4. Frequency ranges from 2 H z to 32.768Khz. Maximum useful sink current is 25 ma while source current is 10 ma. Square wave output can be used to as another clock interrupt. T o enable, set jumper J3[4-6]. This puts the periodic interrupt to CPU INT0. Make sure you ar e not using INT0 on expansion port J2. This output can also be used to trigger periodic A-D conversions. The analog input must be enabled for external triggers. Jumper J1[16] to J3[4] to do this. See demo program AIN220-3.C. You can get a square wave output at J3-4 in the monitor mo de u si ng th e M P co mm and . S imp ly enter 0 x3 1 at I/O address 0xA00A and 0x8f at address 0xA00B. Square wave output at J3-4 is 256 Hz. To change the Page 7-2