SlideShare a Scribd company logo
1 of 10
RTC (Real-Time-Clock)
for Commodore PETs
Leif Bloomquist
Toronto 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 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
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

More Related Content

More from Leif Bloomquist

Motion-Sensing Gaming Glove for the Commodore 64
Motion-Sensing Gaming Glove for the Commodore 64Motion-Sensing Gaming Glove for the Commodore 64
Motion-Sensing Gaming Glove for the Commodore 64
Leif Bloomquist
 

More from Leif Bloomquist (20)

Audible Objects
Audible ObjectsAudible Objects
Audible Objects
 
VIC MIDI (World of Commodore 2015)
VIC MIDI (World of Commodore 2015)VIC MIDI (World of Commodore 2015)
VIC MIDI (World of Commodore 2015)
 
Wi-Fi Modem For the Commodore 64
Wi-Fi Modem For the Commodore 64Wi-Fi Modem For the Commodore 64
Wi-Fi Modem For the Commodore 64
 
More Mad Science for the Commodore 64 (ECCC 2015)
More Mad Science for the Commodore 64 (ECCC 2015)More Mad Science for the Commodore 64 (ECCC 2015)
More Mad Science for the Commodore 64 (ECCC 2015)
 
Marc Garneau Collegiate Institute
Marc Garneau Collegiate InstituteMarc Garneau Collegiate Institute
Marc Garneau Collegiate Institute
 
MIDI Mad Science and Mayhem (Soundhackers #5 "Controller Crazy")
MIDI Mad Science and Mayhem (Soundhackers #5 "Controller Crazy")MIDI Mad Science and Mayhem (Soundhackers #5 "Controller Crazy")
MIDI Mad Science and Mayhem (Soundhackers #5 "Controller Crazy")
 
Motion-Sensing Gaming Glove for the Commodore 64
Motion-Sensing Gaming Glove for the Commodore 64Motion-Sensing Gaming Glove for the Commodore 64
Motion-Sensing Gaming Glove for the Commodore 64
 
New Commodore 64 Network Game Developments
New Commodore 64 Network Game DevelopmentsNew Commodore 64 Network Game Developments
New Commodore 64 Network Game Developments
 
Wifi For the Commodore 64 (ECCC 2013)
Wifi For the Commodore 64 (ECCC 2013)Wifi For the Commodore 64 (ECCC 2013)
Wifi For the Commodore 64 (ECCC 2013)
 
Software Requirements and Design Process in the Aerospace Industry
Software Requirements and Design Process in the Aerospace IndustrySoftware Requirements and Design Process in the Aerospace Industry
Software Requirements and Design Process in the Aerospace Industry
 
CANADA IN SPACE
CANADA IN SPACECANADA IN SPACE
CANADA IN SPACE
 
TCP/IP For Engineers
TCP/IP For EngineersTCP/IP For Engineers
TCP/IP For Engineers
 
Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Internet Technology for the Commodore 64
Internet Technology for the Commodore 64
 
Commodore 64 Telnet BBS Server
Commodore 64 Telnet BBS ServerCommodore 64 Telnet BBS Server
Commodore 64 Telnet BBS Server
 
Artillery Duel Network
Artillery Duel NetworkArtillery Duel Network
Artillery Duel Network
 
World of Commodore 2009 Posters
World of Commodore 2009 PostersWorld of Commodore 2009 Posters
World of Commodore 2009 Posters
 
Retrocomputers as Hacking Platforms
Retrocomputers as Hacking PlatformsRetrocomputers as Hacking Platforms
Retrocomputers as Hacking Platforms
 
NetRacer for the Commodore 64
NetRacer for the Commodore 64NetRacer for the Commodore 64
NetRacer for the Commodore 64
 
The Dancer From The Dance: Mapping Motion With Sound Via Radio Transmission
The Dancer From The Dance:  Mapping Motion With Sound Via Radio TransmissionThe Dancer From The Dance:  Mapping Motion With Sound Via Radio Transmission
The Dancer From The Dance: Mapping Motion With Sound Via Radio Transmission
 
Ultimate Modded Commodore VIC-20
Ultimate Modded Commodore VIC-20Ultimate Modded Commodore VIC-20
Ultimate Modded Commodore VIC-20
 

Recently uploaded

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Recently uploaded (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 

Real-Time Clock for Commodore PETs

  • 1. RTC (Real-Time-Clock) for Commodore PETs Leif Bloomquist Toronto PET User’s Group World of Commodore 2006
  • 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
  • 7. Circuit for Setting RTC Time 8-Bit Baby Board
  • 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