RTC Query
Re: RTC Query
just as experiment.....
For anyone who wants to give it a try....
Arduino code + Superbasic file
please ignore the weather tningy.... I am not ready for HTTPS yet
Would like to see if anyone can add nice things as well...
It works perfect on a Q68
I don`t have a cable for my old ql so I couldn't try it.
Probably the baud rate should than be 9600 max I think
For anyone who wants to give it a try....
Arduino code + Superbasic file
please ignore the weather tningy.... I am not ready for HTTPS yet
Would like to see if anyone can add nice things as well...
It works perfect on a Q68
I don`t have a cable for my old ql so I couldn't try it.
Probably the baud rate should than be 9600 max I think
- Attachments
-
- Ql_serial (1).zip
- (5.64 KiB) Downloaded 11 times
-
- esp_ql.zip
- (516 Bytes) Downloaded 15 times
Last edited by NL_QL_Usr on Fri Mar 15, 2024 1:01 pm, edited 1 time in total.
Re: RTC Query
If you simply want an NTP client for the Q68, there's a tiny one here: https://github.com/tofro/Q68NTPNL_QL_Usr wrote: ↑Fri Mar 15, 2024 11:30 am just as experiment.....
For anyone who wants to give it a try....
Arduino code + Superbasic file
please ignore the weather tningy.... I am not ready for HTTPS yet
Would like to see if anyone can add nice things as well...
It works perfect on a Q68
I don`t have a cable for my old ql so I couldn't try it.
Probably the baud rate should than be 9600 max I think
Obviously won't help anyone who wants to set their QL clock
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: RTC Query
It was not mend for the Q68
But the same code could be used for an awful lot of nice things
On the Q68 my RTC works great!!
Re: RTC Query
Cool. Which network driver do you use?tofro wrote: ↑Fri Mar 15, 2024 12:32 pm If you simply want an NTP client for the Q68, there's a tiny one here: https://github.com/tofro/Q68NTP
Which brings up the QL ethernet question again - with a CP2200 the Q68 stuff could be mostly re-used.
Re: RTC Query
Martin's. But as NTP is using UDP, Wolfgang's might possibly work as well - Haven't tried, though.Peter wrote: ↑Fri Mar 15, 2024 6:43 pmCool. Which network driver do you use?tofro wrote: ↑Fri Mar 15, 2024 12:32 pm If you simply want an NTP client for the Q68, there's a tiny one here: https://github.com/tofro/Q68NTP
ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
Re: RTC Query
Hey Tofro;tofro wrote: ↑Fri Mar 15, 2024 12:32 pm
If you simply want an NTP client for the Q68, there's a tiny one here: https://github.com/tofro/Q68NTP
Obviously won't help anyone who wants to set their QL clock
Saw your NTP client very nice!!!!
I have done some asm programming years ago
would be nice to try that again.
But thanks for your code
Re: RTC Query
I'm nearly in business
Wi-fi modem has arrived and is connected to my wi-fi and QL
And (after issuing a AT&T command to setup the NTP server) I now simply have to issue an ATI7 command to get current date/time
Still trying to find more details on the AT&T command so I can set the best timezone (given BST is on the way) and more importantly setting a better date/time format (my guesses haven't worked so far)
EDIT: sussed the format %dd/%MM/%yyyy %hh:%mm:%ss, now to sort the timezone (as BST is several hours out!)
Now I need to write a basic (or assembler) utility to run at boot to grab the date/time from the modem and set it on the QL
Wi-fi modem has arrived and is connected to my wi-fi and QL
And (after issuing a AT&T command to setup the NTP server) I now simply have to issue an ATI7 command to get current date/time
Still trying to find more details on the AT&T command so I can set the best timezone (given BST is on the way) and more importantly setting a better date/time format (my guesses haven't worked so far)
EDIT: sussed the format %dd/%MM/%yyyy %hh:%mm:%ss, now to sort the timezone (as BST is several hours out!)
Now I need to write a basic (or assembler) utility to run at boot to grab the date/time from the modem and set it on the QL
Re: RTC Query
It works! (Unashamedly stole some code from NL_QL_USR)
It's very rough and ready at the moment, need some more error trapping etc.
It's very rough and ready at the moment, need some more error trapping etc.
Code: Select all
100 OPEN #8,ser2h
110 BAUD 1200
120 PRINT #8,"AT&T" & CHR$(34) & "GMT,%yyyy%MM%dd%HH%mm%ss,0.uk.pool.ntp.org" & CHR$(34)
130 INPUT #8,a$
140 IF a$(1 TO 2)<>"OK" THEN GO TO 130
150 PRINT #8,"ATI7"
160 t$=a$
170 INPUT #8,a$
180 IF a$(1 TO 2)<>"OK" THEN GO TO 160
190 CLOSE #8
200 ye=t$(1 TO 4)
210 mn=t$(5 TO 6)
220 dd=t$(7 TO 8)
230 hh=t$(9 TO 10)
240 mi=t$(11 TO 12)
250 s=t$(13 TO 14)
260 PRINT #0,"Date/Time: " & t$(1 TO 14)
270 SDATE ye,mn,dd,hh,mi,s
Re: RTC Query
As I use the same QIMSI images for real QL & Q-emuLator I realised I needed a version that wouldn't hang up waiting for an input so have merged the following into my boot file
Code: Select all
500 OPEN #8,ser2h
510 BAUD 1200
520 PRINT #8,"AT&T" & CHR$(34) & "GMT,%yyyy%MM%dd%HH%mm%ss,0.uk.pool.ntp.org" & CHR$(34)
530 a$=GetLine$(8)
540 IF a$="" THEN GO TO 700
550 IF a$(1 TO 2)<>"OK" THEN GO TO 530
560 PRINT #8,"ATI7"
570 t$=a$
580 a$=GetLine$(8)
590 IF a$="" THEN GO TO 700
600 IF a$(1 TO 2)<>"OK" THEN GO TO 570
620 ye=t$(1 TO 4)
630 mn=t$(5 TO 6)
640 dd=t$(7 TO 8)
650 hh=t$(9 TO 10)
660 mi=t$(11 TO 12)
670 s=t$(13 TO 14)
680 PRINT #0,"Date/Time: " & t$(7 TO 8) & "/" & t$(5 TO 6) & "/" & t$(1 TO 4) & " " & t$(9 TO 10) & ":" & t$(11 TO 12) & ":" & t$(13 TO 14)
690 SDATE ye,mn,dd,hh,mi,s
700 CLOSE #8
710 DEFine FuNction GetLine$(ch)
720 i$=""
730 c$=INKEY$(#ch,100)
740 IF c$="" THEN RETurn ""
750 IF c$=CHR$(10) THEN RETurn i$
760 i$=i$ & c$
770 GO TO 730
780 END DEFine