real-time clock for commodore pets
DESCRIPTION
An overview of my project to interface an RTC to the Commodore PET.TRANSCRIPT
RTC (Real-Time-Clock)for Commodore PETs
Leif BloomquistToronto PET User’s Group
World of Commodore 2006
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
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
The BQ4830Y RTC Chip
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!
Circuit for Setting RTC Time(Thanks Brian Lyons!)
Upper 8K of RTC appears at $A000 to $BFFF
Circuit for Setting RTC Time
8-Bit Baby Board
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
Reading Date & Time on the PET
10 SYS 4000020 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 + D50 PRINT DT,H ”:” MM “:” S