I wanted the RTC project to be over but it wasn't long before daylight savings kicked in and I needed to reset the clock. All I wanted to do was be able to run a program on the Atari8 to set the time on the RTC and then have it rerun the SETCLOCK.BAS to update the clock on the Atari8.
And as long as I was going to do that I may as well reconfigure the hardware and………. . So by the time I was finished it needed to be called version 2.1.
When I found Arduino Uno clones for $6.50 it didn't seem cost effective to build my own PCB. Then the price of the bare Sparkfun prototype shield seemed reasonable so I used one of those.
The parts list for the shield:
Prototype shield and pins
RS232 to TTL converter module
Set CLOCK push button
330 ohm Resister
Micro switch for Arduino reset on shield. (not required, you can hold down set button and turn power off and on)
The schematic shows the pin usage and wiring. How you place your components may be different. There is more then one design of prototype shields and components.
This time the power for the RTC module is supplied by Analog pin 2 and 3. The pins were set for output and pin 2 was set to Low(ground) and pin3 was set to HIGH(+5V).
The RS232 converter is wired to digital pin10 and 11. This allowed the USB serial on pin D0 and D1 to be used for programming and power. The softwareSerial library was used to send and receive data to the Atari8. (This also created the option of using both USB and RS232 ports at a later date.)
The set time button is used to activate the routine to receive RTC data from the Atari8. Press the button then power up the unit or press the reset button. The LED should turn on, indicating that the Arduino is ready to receive the data from SETRTC.BAS program.
The arduino sketch and atr disk image are contained in the .zip file.
Of course the Arduino software was rewritten. Version 2.0 tested the softwareSerial library. (http://www.arduino.c.../SoftwareSerial) Once that was working the set RTC function was implemented and called v2.1. (I know someone is going to want to know what happened to version 2.0. )
The SETCLOCK.BAS program is still the same program as before and is run by the same AUTORUN.SYS file.
The SETRTC.BAS is new. Once the Clock is running and you want to reset the time on RTC; run this program. It sets up the 850 for serial output then gathers the time/date information. Although the Atari Clock uses only the time data, the RTC needs the date data to reset.(who knows, some day you may need the date.) There is no AM/PM option; time will need to be military time.
The computer then waits for you to put the Arduino in set time mode. Press the button and then press the reset button. When the LED lights the Arduino is ready to accept the data. Press RETURN on the Atari.
The Atari8 then sends the data to the RTC and runs SETCLOCK.BAS to resets the ATARI clock with the new time.
Can it be any simpler?
Since I expect this to be a one of a kind project. Feel free to use this as reference or modify it to suit your needs. Even if you're trying to use it with your RS232 equipped C64.