Last active
February 6, 2020 13:28
-
-
Save kuninet/26511e2dccf8230bb4857b7703433303 to your computer and use it in GitHub Desktop.
N-BASICによるRTC-4543SA時刻設定プログラム
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 'RTC4543SA RTC DATE TIME SET | |
20 CLEAR 300,&HBFFF | |
30 DEFUSR0=&HC003 'WRITE RTC | |
40 DEFUSR1=&HC000 'READ RTC AND SET PC-8001 DATE&TIME | |
50 PRINT | |
60 PRINT "-----------------" | |
70 PRINT DATE$;" ";TIME$ | |
80 PRINT "-----------------" | |
90 PRINT "YYMMDDyHHMMSS (y:SUN=0,MON=1...SAT=6)" | |
100 PRINT "-----------------" | |
110 INPUT DT$:IF DT$="" THEN END | |
120 IF LEN(DT$)<>13 THEN BEEP:GOTO110 | |
130 N=12:GOSUB210:POKE&HC006,W | |
140 N=10:GOSUB210:POKE&HC007,W | |
150 N=8:GOSUB210:POKE&HC008,W | |
160 N=7:GOSUB230:POKE&HC009,WH | |
170 N=5:GOSUB210:POKE&HC00A,W | |
180 N=3:GOSUB210:POKE&HC00B,W | |
190 N=1:GOSUB210:POKE&HC00C,W | |
200 A=USR0(0):A=USR1(0):DT$="":GOTO50 | |
210 ' | |
220 GOSUB230:GOSUB240:W=WH*16+WL:RETURN | |
230 WH=ASC(MID$(DT$,N,1))-ASC("0"):RETURN | |
240 WL=ASC(MID$(DT$,N+1,1))-ASC("0"):RETURN |
Author
kuninet
commented
Feb 6, 2020
•
- 下記 PC-8001用 RTC-4543SAライブラリを使用しています。
- https://github.com/chiqlappe/rtc
- PC-8001--8255--RTC4543SAと接続します
- DATA=PA0
- CE=PC0
- WR=PC1
- CLK=PC2
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment