2
0

max80rtc.bas 536 B

1234567891011121314151617181920212223242526
  1. 100 REM **** Read MAX80 RTC ****
  2. 110 DIM T%(8%)
  3. 120 OUT 1%,54%
  4. 130 I%=0%
  5. 140 IF I%>8% THEN 340
  6. 150 IF (INP(1%) AND 130%)=2% THEN 190
  7. 160 Z%=INP(0%)
  8. 170 I%=I%+1%
  9. 180 GOTO 140
  10. 190 IF INP(0%)<>211% THEN 340
  11. 200 OUT 2%,128%
  12. 210 IF (INP(1%) AND 130%)<>128% THEN 340
  13. 220 FOR I%=0% TO 7%
  14. 230 T%(I%)=INP(0%)
  15. 240 NEXT I%
  16. 250 D$=""
  17. 260 FOR I%=0% TO 7%
  18. 270 IF T%(I%)<10% D$=D$+"0"
  19. 280 D$=D$+RIGHT$(NUM$(T%(I%)),2%)
  20. 290 S0$=MID$("_-- ::._",I%+1%,1%)
  21. 300 IF S0$<>"_" THEN D$=D$+S0$
  22. 310 NEXT I%
  23. 320 ; D$
  24. 330 END
  25. 340 ; "No MAX80 RTC detected"
  26. 350 END