• Please review our updated Terms and Rules here

PET RTC option Question

Hugo Holden

Veteran Member
Joined
Dec 23, 2015
Messages
4,808
Location
Australia
There are some RTC clock modules such as the BQ4830Y which, with an adapter board, can plug into a spare ROM socket on the PET. These look like RAM to the computer.

But, I was wondering, does anybody know if there is an RTC module (perhaps a Dallas part) that would plug directly into a spare PET ROM socket and , simply look like a RAM IC plugged in there, without requiring an adapter board ?
 
Forgive me, but it's been more than 40 years since I last looked at a PET schematic.

Do any of those ROM sockets have a valid write signal going to them? I sorta think not,
so if not an adapter board, some kludges to get it there.
 
Forgive me, but it's been more than 40 years since I last looked at a PET schematic.

Do any of those ROM sockets have a valid write signal going to them? I sorta think not,
so if not an adapter board, some kludges to get it there.
Yes, at least it would need a R/W line initially program it, but I had the idea that since it is a battery backed up device, it could be programmed initially for the correct date and time, outside of the PET, and simply placed in the ROM socket as read only device/clock.
 
Ummm... possible, but the devil's in the details. First, what size are those ROMs (in pins and bytes), and if 24, how long has it been since Dallas made a 24p Smartwatch? Did they ultimately ditch those parts in favour of the 28s and 32s along the way? And iIrc, you "unlocked" them to get at the clock registers by writing a specific sequence (of 64 bits?) to one of the data bits (address unimportant), after which the following 64 reads would give you the RTC data serially on the same bit. So the read-only operation you envision wouldn't work. At least, that's what I can tell you offa the top of my bald head, without reaching for the data book.
 
And iIrc, you "unlocked" them to get at the clock registers by writing a specific sequence (of 64 bits?) to one of the data bits (address unimportant), after which the following 64 reads would give you the RTC data serially on the same bit. So the read-only operation you envision wouldn't work. At least, that's what I can tell you offa the top of my bald head, without reaching for the data book.

Actually, no. The “smartwatch” style chips like the DS1215 work in read-only ROM sockets because they can in effect be written by reads. You do need to “write” a long arcane patterns of bits to the socket address to trigger the smartwatch to override the chip select of the memory device chained after it, but the chip can be wired to listen to the data lines with just chip enable active; you don’t need to have an explicit write signal on the socket. After unlocking you either read the current time serially over a single data bit or program it by using the right address pattern; in ROM mode you connect the write signal of the DS1215 to an address bit. They’re pretty clever, really; they include lights-off detection circuitry allowing them to share the clock battery with a low power SRAM (IE, DIY NVRAM), and can also be put in front of a peripheral chip instead of a memory device as long as it has address lines.

I can’t think of a reason why you couldn’t use a DS1215 in a PET, although the slightly nonstandard ROM socket pinouts would probably require a DIY board instead of an off the shelf one, and the software to read/write them is a little gross. (It does exist in 6502 form, however; these were used in Apple IIs.) The only dealbreaker to using one would be if you had a machine with buffers in front of the ROM chips that only opened unidirectionally when the chips were addressed, and I don’t actually think the PET has buffers between the ROMs and CPU at all.

Edit: just to be clear, the DS1215 is the actual chip that came potted inside those “smartwatch” sockets along with a clock crystal and battery; the factory potted one was the 1216. The bare chips are readily available as scrap if you want to DIY one cheap, but the company also still makes a modernized version as the DS1315.

Edit, again: I looked at the datasheet to refresh my memory about the key sequence, corrections made.
 
Last edited:
Thanks for the corrections/details - I'll pull the databook too and refresh my memory.

But what about those ROMs deviated from the bytewide JEDEC standard? Did they change the enable polarity or something?
 
But what about those ROMs deviated from the bytewide JEDEC standard? Did they change the enable polarity or something?

It's been forever since I messed with that so I'm fuzzy on the details... here's a page talking about issues trying to use generic EPROMs in a PET. That said, if you could actually *find* an already assembled DS1216 compatible with DIP24 sockets the changes might not matter. (Reactive micro sells a 28 pin no-slot clock for the Apple IIe but the manual describes using it in a 24 pin socket by jumpering pins together. It looks like the Apple II's mask ROM pinouts were similar to the PETs, so by extension maybe you'd be fine?)

If you'd rather roll your own making one yourself would be easy. I definitely wouldn't go seeking out an old potted one, I'm sure they *all* have dead batteries by now. Here's an assembly language dump of a ProDOS driver for the chip, the routines for manipulating the clock should be reasonably portable to the PET.

I made my own DS1215-based clock (tacked onto an XTIDE implementation] as my second PCB project just by following the datasheet, they really are simple beasts. If you were willing to make a horrible mess of wires you could almost dead-bug one onto a board.
 
Not that there was/is anything tricky about the driver - it's really straightforward, and it'll look completely familiar to anyone who ever had to bit-bang serial data through a parallel port bit.
 
It’s only really “gross” compared to a non-phantom clock chip that presents itself as a conventional I/O register file. You could of course interface something like that to the user port, but, eh, I like the DS1215.

Speaking of serial, another option for rolling your own might be those I2C DS3231 clock modules they sell very cheap for Arduino-type applications. (You can get a module for like $3.) Could probably drive one of those off the user port with a bit of clever thinking.
 
Sure, but it's not "gross" if you consider their intent. There have always been "conventional" RTCs out there. As I'm sure you know, Dallas's (and, to be fair, MOSTEK's before them) very appealing pitch was to offer the designer the ability to kill three birds with one stone: Not only are we going to add a battery to the RAM you already have in your system to make it nonvolatile, but we're going to give you an RTC that you won't have to change a damn thing in your memory map for. Wanna call that driver nasty? Fine. But as a hardware designer being offered it at the time, I thought it was pretty darn sweet, and the programmers I worked with didn't mind a bit.
 
Wanna call that driver nasty? Fine. But as a hardware designer being offered it at the time, I thought it was pretty darn sweet, and the programmers I worked with didn't mind a bit.

I’m getting the impression you’re getting wound up over this, and, well, to be clear it’s solidly misplaced. They’re great devices, my editorial take on them was simply trying to make it clear that in most instances you’ll probably need an assembly language driver for them, which is intimidating for some people if they have to write it. A clock that hangs off a decoded I/O port is going to look more attractive if their comfort level is something they can read with a PEEK or IN command in BASIC.
 
Nah, not to worry - I'm the furthest thing from "wound up". I could direct you to examples of such, but you'd need a sedative and an oxygen bottle handy.

I get what you're saying, and you're probably right about a little assembly (or C) driver being somewhat beyond the peek'n'poke crowd. But rather than being a comment on how weird, crazy, difficult, or unconventional the part is, it speaks more to the limited capabilities of that audience.
 
Back
Top