RTC Query

Nagging hardware related question? Post here!
User avatar
t0nyt
Gold Card
Posts: 384
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

RTC Query

Post by t0nyt »

I know pretty much nothing about electronics (as has been proven in various threads) but I was wondering if it would be feasible to connect one of those cheap battery backed RTC i2c (designed for Arduino, Pi etc) to an i2c to rs232 converter and then connect that into SER2 and be able to query the date/time to set the QL clock at boot

Any thoughts please?

Many thanks


User avatar
t0nyt
Gold Card
Posts: 384
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: RTC Query

Post by t0nyt »

Maybe it would be better to build a rs232 to WiFi modem bridge as the 2 parts needed are dirt cheap and widely available

But i’m going to use a laptop as a temporary bridge initially, to test setting the QL clock via an internet timeserver over rs232/wifi


User avatar
tofro
Font of All Knowledge
Posts: 2702
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: RTC Query

Post by tofro »

There seem to be simple I2C-to-RS232 adapters that allow you to connect I2C devices to RS232 serial interfaces.

Here's a link to such an adapter kit: https://www.horter-shop.de/de/i2c-pc-ad ... 60547.html

(Note I haven't tried wether that works with the QL, but don' see much reason why it shouldn't. These things seem to be doing the level shifting and clock generation, there's still some software to write)


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
Pr0f
QL Wafer Drive
Posts: 1307
Joined: Thu Oct 12, 2017 9:54 am

Re: RTC Query

Post by Pr0f »

The Minerva MKII has I2C interface and does have an on board I2C RTC and RAM chip.

There is a project ongoing on here to recreate the PCB for that - the code is already in the Minerva ROM


User avatar
t0nyt
Gold Card
Posts: 384
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: RTC Query

Post by t0nyt »

tofro wrote: Tue Mar 12, 2024 8:32 am There seem to be simple I2C-to-RS232 adapters that allow you to connect I2C devices to RS232 serial interfaces.

Here's a link to such an adapter kit: https://www.horter-shop.de/de/i2c-pc-ad ... 60547.html

(Note I haven't tried wether that works with the QL, but don' see much reason why it shouldn't. These things seem to be doing the level shifting and clock generation, there's still some software to write)
Thanks, have ordered one to have a play


User avatar
t0nyt
Gold Card
Posts: 384
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: RTC Query

Post by t0nyt »

Pr0f wrote: Tue Mar 12, 2024 8:51 am The Minerva MKII has I2C interface and does have an on board I2C RTC and RAM chip.

There is a project ongoing on here to recreate the PCB for that - the code is already in the Minerva ROM
Minerva 2 would interest me for the RTC element, though I prefer to run JS rom (I have a Minerva 1 for memory diagnostics, but it lives in an anti-static bag)

Many thanks


User avatar
Pr0f
QL Wafer Drive
Posts: 1307
Joined: Thu Oct 12, 2017 9:54 am

Re: RTC Query

Post by Pr0f »

The other approach would be to use an RTC chip that actually does have a "seconds counter" and just disable the ZX8302 whenever a read access to those RTC addresses is made - and provide the data from the seconds counter RTC chip instead. No I2C needed - as the code in the QL is already setup to read the RTC and process the format.

What you would need to do is provide some function to set the RTC - but I am guessing that doesn't need to be done that often, and a BASIC program offering that may suffice.


User avatar
t0nyt
Gold Card
Posts: 384
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: RTC Query

Post by t0nyt »

Pr0f wrote: Tue Mar 12, 2024 9:53 am The other approach would be to use an RTC chip that actually does have a "seconds counter" and just disable the ZX8302 whenever a read access to those RTC addresses is made - and provide the data from the seconds counter RTC chip instead. No I2C needed - as the code in the QL is already setup to read the RTC and process the format.

What you would need to do is provide some function to set the RTC - but I am guessing that doesn't need to be done that often, and a BASIC program offering that may suffice.
That sounds way above my pay grade! :shock:

Also, I don’t really want to modify the mobo (other than necessary repairs)

Adding RAM, changing ROM to JS and attaching plug-in storage/other solutions are as far as I want to go really.

Many thanks


User avatar
t0nyt
Gold Card
Posts: 384
Joined: Wed Nov 22, 2023 6:46 pm
Location: UK

Re: RTC Query

Post by t0nyt »

I have the I2C/RS232 adapter, an I2C RTC and some QL serial leads all ordered.

May need some other odd bits I haven’t thought of yet though too

Whether I’ll be able to achieve what I want is a different matter!


User avatar
Peter
Font of All Knowledge
Posts: 2009
Joined: Sat Jan 22, 2011 8:47 am

Re: RTC Query

Post by Peter »

tofro wrote: Tue Mar 12, 2024 8:32 am Here's a link to such an adapter kit: https://www.horter-shop.de/de/i2c-pc-ad ... 60547.html

(Note I haven't tried wether that works with the QL, but don' see much reason why it shouldn't. These things seem to be doing the level shifting and clock generation, there's still some software to write)
Won't work directly, since it uses the DSR line which the QL does not provide.


Post Reply