Jump to content
  • entries
    87
  • comments
    46
  • views
    71,248

Atari Clock & RTC pt.3 of 3

k-Pack

618 views

The Arduino is sending data to the 850 every second, the Atari has the Clock and R: handler loaded, and the only thing left is to write the BASIC program to get the time from the 850 and set the clock.

I took the original CLOCK2.BAS and turned it into a pile of spaghetti code and called it SETCL850.BAS. It gets the job done but I know there are more errors then have been anticipated.

This ATR is a single density disk image with DOS.SYS 2.5, the AUTORUN.SYS from pt.2, and the SECTCLOCK.BAS program(SETCL850.BASE renamed).clock.atr

PROGRAM:
Because the Arduino was only used for a short time during boot up, it was often unplugged to conserve the 9volt battery. Line 210 is a reminder that the Arduino had to be turned on. Also trying to reset the clock after running DUP.SYS would lock up the computer. Both looked the same. Powering up the Arduino should allow the program to continue. The message should be replaced within a couple of seconds with the program title.

220
sets up the 850 interface for input. The first INPUT clears the 850 buffer the second INPUT reads the latest time information. This information is from the manual. When printing the input to the screen the first input always looked good to me. The second read always had a carnage return as the first character.

250 The position of the time within the RTC$ is not the same during the day. A leading zero is not used when the time is before 10 o'clock. HR$, MIN$ and SEC$ are set by locating the first occurrence of ":" in the RTC$ string and then calculating their relative positions.

285 Remember that carriage return in position 1 of RTC$ when its before 10:00? It could end up in position 1 of HR$. This line turns it into a leading "0".

290 The ATARI CLOCK is a 12 hour clock and the RTC is 24 hr. HR$ is adjusted if afternoon.

2500-2700 Sends the time string variables to a subroutine to convert to a single binary coded decimal byte.

2800 sets the clock and t
urns on the display.

2900 END : can be replaced with a RUN "D:filename or NEW to clear the program

This ATR contains all the files for this project. View README.TXT for descriptions.
clock rs.atr

As far as it goes, the program and hardware work for me. There are so many ways to improve. I could spend a considerable amount of time just making it look better then a hack job. I suppose it will all depend on how much I use the clock.

What's next? Optimization? Design a bare bones Arduino board with RS232 port and RTC? A program to set the time on the RTC? Transfer data through the joystick or SIO port? "Time management for the Retired" software? Set the SpartaDOS clock? Get the bicycle ready for good weather? ……………………………..



0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...