2. Project Summary
• PET used to track items in freezer!
• Advantageous to datestamp items
• Queries like, “Any pizza over 6 months old?”
• Originally entered date manually
• Want to have the PET keep time itself
3. The BQ4830Y RTC Chip
(Texas Instruments)
• Looks like normal RAM to the computer!
• Simply PEEK/POKE to read/set time
• Battery backed RAM (32K), clock, crystal
all in one package
• Simply plugs into PET Option ROM socket
• 24/28 pin adaptor required
5. Issues
• Read/Write line from 6502 not available at
Option ROM socket
• C64’s PLA prevents writing to external RAM
(can be worked around, but awkward)
• Solution: Use VIC-20 to set the time!
6. Circuit for Setting RTC Time(Thanks Brian Lyons!)
Upper 8K of RTC appears at $A000 to $BFFF
8. Reading Date & Time on the PET
• Date & Time are stored as Binary Coded
Decimal (BCD)
e.g. 0x14 hex means 14 decimal, not 20!
• Developed BCD->Decimal conversion
program with Lookup Table
• Program stored in BQ4830 non-volatile RAM
• SYS 40000, then PEEK() memory in
cassette buffer RAM
9. Reading Date & Time on the PET
10 SYS 40000
20 Y=2000+PEEK(700):M=PEEK(701):D=PEEK(702)
30 H=PEEK(704):MM=PEEK(705):S=PEEK(706)
40 DT=Y*10000 + M*100 + D
50 PRINT DT,H ”:” MM “:” S
10. Reading Date & Time on the PET
10 SYS 40000
20 Y=2000+PEEK(700):M=PEEK(701):D=PEEK(702)
30 H=PEEK(704):MM=PEEK(705):S=PEEK(706)
40 DT=Y*10000 + M*100 + D
50 PRINT DT,H ”:” MM “:” S