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

Multiplayer RogueLike Game for the Commodore 64
Multiplayer RogueLike Game for the Commodore 64Multiplayer RogueLike Game for the Commodore 64
Multiplayer RogueLike Game for the Commodore 64Leif Bloomquist
 
VIC MIDI (World of Commodore 2015)
VIC MIDI (World of Commodore 2015)VIC MIDI (World of Commodore 2015)
VIC MIDI (World of Commodore 2015)Leif Bloomquist
 
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 64Leif Bloomquist
 
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)Leif Bloomquist
 
Marc Garneau Collegiate Institute
Marc Garneau Collegiate InstituteMarc Garneau Collegiate Institute
Marc Garneau Collegiate InstituteLeif Bloomquist
 
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")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 64Leif Bloomquist
 
New Commodore 64 Network Game Developments
New Commodore 64 Network Game DevelopmentsNew Commodore 64 Network Game Developments
New Commodore 64 Network Game DevelopmentsLeif Bloomquist
 
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)Leif Bloomquist
 
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 IndustryLeif Bloomquist
 
Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Internet Technology for the Commodore 64
Internet Technology for the Commodore 64Leif Bloomquist
 
Commodore 64 Telnet BBS Server
Commodore 64 Telnet BBS ServerCommodore 64 Telnet BBS Server
Commodore 64 Telnet BBS ServerLeif Bloomquist
 
World of Commodore 2009 Posters
World of Commodore 2009 PostersWorld of Commodore 2009 Posters
World of Commodore 2009 PostersLeif Bloomquist
 
Retrocomputers as Hacking Platforms
Retrocomputers as Hacking PlatformsRetrocomputers as Hacking Platforms
Retrocomputers as Hacking PlatformsLeif Bloomquist
 
NetRacer for the Commodore 64
NetRacer for the Commodore 64NetRacer for the Commodore 64
NetRacer for the Commodore 64Leif Bloomquist
 
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 TransmissionLeif Bloomquist
 

More from Leif Bloomquist (20)

Multiplayer RogueLike Game for the Commodore 64
Multiplayer RogueLike Game for the Commodore 64Multiplayer RogueLike Game for the Commodore 64
Multiplayer RogueLike Game for the Commodore 64
 
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
 

Recently uploaded

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 

Recently uploaded (20)

SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 

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