real-time clock for commodore pets

9
RTC (Real-Time-Clock) for Commodore PETs Leif Bloomquist Toronto PET User’s Group World of Commodore 2006

Upload: leif-bloomquist

Post on 18-Jun-2015

202 views

Category:

Technology


1 download

DESCRIPTION

An overview of my project to interface an RTC to the Commodore PET.

TRANSCRIPT

Page 1: Real-Time Clock for Commodore PETs

RTC (Real-Time-Clock)for Commodore PETs

Leif BloomquistToronto PET User’s Group

World of Commodore 2006

Page 2: Real-Time Clock for Commodore PETs

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

Page 3: Real-Time Clock for Commodore PETs

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

Page 4: Real-Time Clock for Commodore PETs

The BQ4830Y RTC Chip

Page 5: Real-Time Clock for Commodore PETs

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!

Page 6: Real-Time Clock for Commodore PETs

Circuit for Setting RTC Time(Thanks Brian Lyons!)

Upper 8K of RTC appears at $A000 to $BFFF

Page 7: Real-Time Clock for Commodore PETs

Circuit for Setting RTC Time

8-Bit Baby Board

Page 8: Real-Time Clock for Commodore PETs

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

Page 9: Real-Time Clock for Commodore PETs

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