Jump to content
  • entries
  • comments
  • views

Atari Clock(ANALOG 31) & RTC(DS1307) pt.1



In the June 1985 issue of ANALOG (#31), the "ATARI CLOCK" by Jonathan Buckheit was published. It is a machine language program that added an extra text line to the top of the screen display and printed the time once per second. I remember typing in CLOCK1.BAS to create an AUTORUN.SYS file and CLOCK2.BAS to set the time. I also remember using it but soon tired of inputting the time for each REBOOT.

Download ANALOG issue #31 for more information.

The forums had several links to that issue's disk image. This is one of them. Download AN31 B.atr and check it out.

Almost 5 years ago a RTC circuit was purchased to hook up to the Arduino Uno only so that it would be available for a project. Setting the ATARI CLOCK using data from the RTC seems to be that project. So while I've been waiting for some divine inspiration to point me toward the best way to transfer the data from the Arduino to the Atari, the RTC battery died. I have also tired of waiting for the divine intervention and will start by using the RS232 interface(850 or P:R: Connection) for the link.

Step 1. Find information on RTC and Arduino

As it happened, the RTC in my parts box is a SainSmart I2C RTC DS1307 module, TinyRTC v1.1.( http://www.sainsmart.com/arduino-i2c-rtc-ds1307-at24c32-real-time-clock-module-board-for-avr-arm-pic.html ) There are several boards and different clock chips that can do the job. I don't have enough information to make a recommendation.

Adafruit has a lot of information on their DS-1307 RTC kit. Worth the read. https://learn.adafruit.com/ds1307-real-time-clock-breakout-board-kit/overview

Step 2. Arduino Software:
Arduino.cc has a library that works with the DS-1307 based RTC.

Another source for information and a software example was found at Tronixstuff. John Boxall, author of the book, Arduino Workshop, has written the tutorial. His program does not use a library to set or read the time-date information. This gave me a clearer picture of how it all works. http://tronixstuff.com/2014/12/01/tutorial-using-ds1307-and-ds3231-real-time-clock-modules-with-arduino/


The RTC and Arduino were wired using the tutorial information.

Clock - Arduino
Vcc -5V
Gnd - Gnd
Scl - A5
Sca - A4

I copied the code and pasted it into the Arduino IDE. Then I compiled and ran it. The serial port was then monitored to view time and date. This is when I found out the backup battery was dead. When you change the battery or want to set the clock, the program needs to be modified to call the SETDS3231time function.

Remove the comment delimiter from line in setup() with the SETDS3231time function and set the parameters. The SETDS3231time function needed to be moved to just before setup() function. An undefined function error occurred until it was moved.

The time was now being sent to the serial monitor.

Now, put the comment delimiter back in front of the SETDS3231time in setup() and reprogram the Arduino. If you don't, every time the Arduino is powered up the clock gets reset to the time specified in the call. Most if this is explained in the tutorial. (I disconnected the RTC to be sure I didn't accidently reset the time.)

Step 3. Communicate through the RS232 shield.


The RS232 Shield was plugged into the Arduino and the RTC was wired into the shield. An RS-232 - USB converter was plugged into the computer and RS232 shield. A 9V battery was used to power the Arduino instead of the USB connection because the USB port on the Arduino and RS232 shield share the same pins for data transfer.

The converter was defined as COM3 and reproduced the data stream to the Serial Monitor. The RS232 Shield had been used in a previous project and was expecting these results. (Atari 8 bit <-> 850 Interface <-> RS232 Shield <-> Arduino) .

At least I know that the RTC module, Arduino, RS232 shield are working properly. I'm waiting for a gender changer to make the connection to the 850. And I'm still waiting for that inspiration.


Recommended Comments

There are no comments to display.

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.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...