Jump to content

Search the Community

Showing results for tags 'arduino'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Atari Systems
    • Atari General
    • Atari 2600
    • Atari 5200
    • Atari 7800
    • Atari Lynx
    • Atari Jaguar
    • Dedicated Systems
    • Atari 8-Bit Computers
    • Atari ST/TT/Falcon Computers
  • Classic Consoles
  • Classic Computing
  • Modern Consoles
  • Gaming General
  • Marketplace
  • Community
  • Community
  • Game Programming
  • Site
  • PC Gaming
  • The Club of Clubs's Discussion
  • I Hate Sauron's Topics
  • 1088 XEL/XLD Owners and Builders's Topics
  • Atari BBS Gurus's Community Chat
  • Atari BBS Gurus's BBS Callers
  • Atari BBS Gurus's BBS SysOps
  • Atari BBS Gurus's Resources
  • Atari Lynx Programmer Club's CC65
  • Atari Lynx Programmer Club's ASM
  • Atari Lynx Programmer Club's Lynx Programming
  • Atari Lynx Programmer Club's Music/Sound
  • Atari Lynx Programmer Club's Graphics
  • The Official AtariAge Shitpost Club's Shitty meme repository
  • The Official AtariAge Shitpost Club's Read this before you enter too deep
  • Arcade Gaming's Discussion
  • Tesla's Vehicles
  • Tesla's Solar
  • Tesla's PowerWall
  • Tesla's General
  • Harmony/Melody's CDFJ
  • Harmony/Melody's DPC+
  • Harmony/Melody's BUS
  • Harmony/Melody's General
  • ZeroPage Homebrew's Discussion
  • Furry Club's Chat/RP
  • PSPMinis.com's General PSP Minis Discussion and Questions
  • PSPMinis.com's Reviews
  • Atari Lynx 30th Birthday's 30th Birthday Programming Competition Games
  • 3D Printing Club's Chat
  • Drivers' Club's Members' Vehicles
  • Drivers' Club's Drives & Events
  • Drivers' Club's Wrenching
  • Drivers' Club's Found in the Wild
  • Drivers' Club's General Discussion
  • Dirtarians's General Discussion
  • Dirtarians's Members' Rigs
  • Dirtarians's Trail Runs & Reports
  • Dirtarians's Wrenching
  • The Green Herb's Discussions
  • Robin Gravel's new blog's My blog
  • Robin Gravel's new blog's Games released
  • Atari Video Club's Harmony Games
  • Atari Video Club's The Atari Gamer
  • Atari Video Club's Video Game Summit
  • Atari Video Club's Discsuuions
  • Star Wars - The Original Trilogy's Star Wars Talk
  • PlusCart User's Bug reports
  • PlusCart User's Discussion
  • DMGD Club's Incoming!
  • DASM's General
  • AtariVox's Topics
  • Gran Turismo's Gran Turismo
  • Gran Turismo's Misc.
  • Gran Turismo's Announcements
  • The Food Club's Food
  • The Food Club's Drinks
  • The Food Club's Read me first!
  • The (Not So) Official Arcade Archives Club's Rules (READ FIRST)
  • The (Not So) Official Arcade Archives Club's Feedback
  • The (Not So) Official Arcade Archives Club's Rumor Mill
  • The (Not So) Official Arcade Archives Club's Coming Soon
  • The (Not So) Official Arcade Archives Club's General Talk
  • The (Not So) Official Arcade Archives Club's High Score Arena
  • Adelaide South Australia Atari Chat's General Chat & Welcome
  • Adelaide South Australia Atari Chat's Meets
  • Adelaide South Australia Atari Chat's Trades & Swaps
  • KC-ACE Reboot's KC-ACE Reboot Forum
  • The Official Lost Gaming Club's Lost Gaming
  • The Official Lost Gaming Club's Undumped Games
  • The Official Lost Gaming Club's Tip Of My Tounge
  • The Official Lost Gaming Club's Lost Gaming Vault
  • The Official Lost Gaming Club's Club Info
  • GIMP Users's Discussion


There are no results to display.

There are no results to display.


  • AtariAge Calendar
  • The Club of Clubs's Events
  • Atari BBS Gurus's Calendar

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start










Custom Status



Currently Playing

Playing Next

Found 12 results

  1. After listening to MIDI Computer Blues V2, I decided to try to simulate some wind chimes but before that was going to happen I had to be able to transmit data at a faster rate. If the tempo of MIDI Computer Blues V2 could be improved there was a chance of making the wind chimes sound real. The Arduino Uno interface loop() was shortened to two lines. I didn't think this was going to make much of a difference and it didn't. /*RS232 to MIDI v2 - 9/14/16 * Pack007 * * This program reads bytes from an RS-232 source * and sends it out to MIDI Device. * * Programmed as an interface between the Atari 850 * Interface Module and a MIDI device. Max baud rate * of 850 is 9600 bps and 31250 bps is required for * MIDI. * */ #include <SoftwareSerial.h> SoftwareSerial RS850(5,6);//RS232 - A850 connection void setup() { RS850.begin(9600); Serial.begin(31250); } void loop() { while(RS850.available()<1){}//wait for data from Atari Serial.write(RS850.read());//read and write byte Next I did the obvious tricks to the BASIC program; moving the send data routine to the start of the program, combined some note information to reduce the number of send short block XIO command and turned off the screen. The increase in speed was minimal but noticeable. Then the 850 manual was read again and decided to OPEN the channel with Aux1 = 9. "9 signifies that you are going to use the port for output only(concurrent mode)". Then the XIO 40 command was issued. BINGO!! The tempo was so fast that the speed was set at 3 for recording. This caused the base note to be played 3 times in quick succession. The lack of a note attack and decay on the Atari masked this effect in the original program. The ZIP file contains a two minute recording of the music made by the program in the ATR. Better Blues.zip So to run this program all you need is this program, an A8, an 850 Interface, an Arduino with an RS-232 and MIDI port, and a MIDI Synth. I'm thinking about adding one more requirement for the next program by writing the Wind Chimes to run under the Diamond GOS. Related Blog Links: http://atariage.com/forums/blog/572/entry-13269-midi-computer-blues-setting-up-the-hardware/ http://atariage.com/forums/blog/572/entry-13277-midi-computer-blues-note-on-note-off/ http://atariage.com/forums/blog/572/entry-13282-midi-computer-blues-v20/
  2. Hey everyone, I wanted to announce my new Electronics and PCB Design course on Udemy. I worked on it for 18 months and tried to create something that would enable people to learn electronics and PCB design in a single course, have fun, and not be overwhelmed by math and too much theory. The goal of the course is to teach electronics both theoretically, but practically as well with lots of bench work. And then once the fundamentals are learned, we dive into PCB design from schematic to manufactured PCB. Those that are interested in building add-on boards for various retro system, but haven't made a PCB, then this is perfect for you. Also, those that "hack" electronics, but want a deeper understanding of analog, filters, amps, and circuit analysis, you will find this course helpful without needing a Ph.D in math Here's the information, links, and discount code... (along with some images of project developed in the course; PCBs, simulation, bread board work). Crash Course Electronics and PCB Design @ Udemy -- 135 lectures, 87 hours. 50% Discount Code HAL9000 https://www.udemy.com/crash-course-electronics-and-pcb-design
  3. What Is It? Hayesduino is an Arduino sketch that provides a bridge between the world of the Internet and small devices that do not have built-in ethernet capabilities. Old computers, such as the Commodore 64, Apple II and Atari 800 have serial ports, but do not have readily available Internet solutions with wide software support. While specialized solutions do exist for these platforms, they all require specialized software to use them and do not lend themselves to more general usage such as simply opening a socket, sending some data, and/or receiving some data. Hayesduino bridges this gap by emulating a Hayes compatible modem. This allows users to initiate Internet communications via sockets that are opened by "dialing" to a hostname and port. An example would be initiating a telnet session with a host by simply typing atdt hostname:23 and waiting for the host to respond. Using this technique, any online socket can be reached and communicated with. Hayesduino could have accomplished this without emulating a modem, but there needed to be a good way to allow the small machine to receive incoming connections. The three platforms listed above were all very popular systems for hosting BBS (bulletin board systems) which would accept calls over a telephone line via modem. Hayesduino simulates the incoming phone call whenever the software receives an inbound connection on port 23 (this is changeable in the code). When an incoming connection is detected, the Hayesduino will toggle the DCE-DCD line to trigger the remote software to answer the incoming "call". In this way a classic BBS can be hooked up directly to the Internet. http://hayesduino.codeplex.com
  4. Within the Atari 800 computer manual is a program called Computer Blues. "This program generates random musical notes to "write" some very interesting melodies for the programmed bass." Maybe the first program I typed in . That same program is in the 1030 XE manual. It was while listening to this program and trying to figure out what to do with an Arduino MIDI shield that I thought, "What would Computer Blues sound like if played through a synthesizer?" Gone is my MIDI Mate, CZ-101 and Roland keyboard controller. The TG-33 and DH-100 have been in storage for quite some time along with the ST and the USB to MIDI cord for the Windows computer. A Casio CTK-481 was acquired in a trade and has been neglected until now because now is the time to find out what Computer Blues would sound like on a synthesizer. I don't remember there ever being an easy way to output midi commands to a MIDIMAX (or MIDIMATE) using Atari BASIC. The more I learn about the MIDI controllers and the MIDI standard the easier it is to imagine experimenting using BASIC. Speed and timing may be a disadvantage for BASIC but a quick and easy way to implement ideas may be an advantage. The plan is to convert the SOUND commands to MIDI command data and send it out to the "R2:" port on the 850. "R2:" will be attached to a RS-232 to TTL converter shield attached to an Arduino Uno. The Arduino will read and retransmit the data through a MIDI shield to the sound synthesizer. The serial port baud rate limit of the 850 is 9600 and the MIDI port will be 31250. Shouldn't be a problem for the Arduino to keep up with the Atari. The RS232 Shield Link sprite Store http://store.linksprite.com/rs232-shield-v2-for-arduino/ LinkSprite RS232 Shield V2 for Arduino is being used to read the RS232 signal from the 850. This board has the option of setting jumpers to use D0 to D7 for the TD and RD lines. D5 and D6 are the first available pins and will require the SoftwareSerial library for communications. To test the shield, the "hello world" program from the RTC project was used with Bobterm. I had problems receiving the data until I switched the jumpers around. Someday I hope to be able to make the connections between RS232 devices and have it work the first time, but not today. The MIDI Shield New version https://www.sparkfun.com/products/12898 This SparkFun MIDI shield has been in my shield collection long enough to have been replaced by another version. The old version requires you to use the Hardware serial lines where as the new version allows you to cut some traces and make the new connections. The shield has a PROG/RUN switch that needs to be set to PROGram the Arduino or RUN the program. It is an experimenters board and has 3 push button switches and 2 analog resistors that can be used as programmable controllers. Pins D0 and D1 are used for serial communications and D2-4 are used by the push button switches. https://www.arduino.cc/en/Tutorial/Midi The shield can be tested using the program in the Arduino MIDI Tutorial (It’s a quick read). Connect a MIDI cable from the MIDI OUT on the shield to the MIDI IN of the synth. Stacking the shields makes all the necessary connections. There are no wires. If you don't use the shields a RS232 to MIDI OUT can be constructed for less then $25. A Uno knockoff and ultra compact TTL to RS232 converter can be had for less then $10 each. A 5Pin-DIN socket and 2-220 ohm resistors should be less then $5. Your biggest expense will be the 850 or PR: connection. Wrap it up All the parts seem to work. Next step will be to sit down and write the Arduino program to read the NoteOn data from the Atari and output it to the MIDI device. Then an Atari BASIC program to send the midi commands to turn on and off a note. When that happens the hard part will be over. References: You may find some of these interesting and informative. MIDI Reference Tables https://www.midi.org/specifications/category/reference-tables MIDI Message Chart- https://www.midi.org/specifications/item/table-1-summary-of-midi-message MIDI Control Change Messages https://www.midi.org/specifications/item/table-3-control-change-messages-data-bytes-2 MIDI note number chart http://newt.phys.unsw.edu.au/jw/notes.html How to read MIDI implementation chart(wish I had this 30 years ago) http://midi-tutor.proboards.com/thread/119/interpret-midi-implementation-chart Tutorial on midi data and file structures. Program examples for QuickBasic. MIDI Programming Part 1: MIDI File Basics - MystikShadows http://www.petesqbsite.com/sections/express/issue18/ MIDI Programming Part 2: Data Structures And Timing Formulas - MystikShadows http://www.petesqbsite.com/sections/express/issue19/ Atari's Sound System by Bob Cockroft - ROM Magazine #10 Gives Atari values for specific Notes and more http://atarimagazines.com/rom/issue10/sound_system.php Notes and Volts - Electronics, Guitars and Geekery http://www.notesandvolts.com/
  5. If capturing text from your Arduino to a terminal buffer is all you want to do, you are lucky. You may want to collect data and use it in your own programs. Unfortunately there are not a lot of example programs to learn from and the 850 interface manual can be cryptic for us mortals. Persistence does pay off. Usually the “let’s try this” style of debugging will eventually get you to the proper combination of port settings and program logic. I wanted to hook up a sensor to the Arduino and then read the output through the RS232 port using Atari BASIC. I choose the ultrasound sensor. It will measure the time it takes a sound wave to travel from the sender to an object and back. If you know the speed of sound you can calculate the distance. Now you can imagine that by moving your hand in front of the sensor you can program the SOUND command to change pitch. You can imagine it but doing it may not be so practical. The Arduino Side There are several manufactures of ultrasound sensors. Some will have 3 pins, some will have 4. Both have a +5 volt and GrouND pins. If the sensor has 4 pins, one will trigger the sound pulse and the other change logic states when it senses the sound. I am using the Parallax Ping))) sensor. One data pin is used as output to trigger the pulse. Before the pulse can travel back from an object the pin is set as input. The Ping))) sensor was previously wired and running using an example program in “Arduino: A Quick-Start Guide”. Remember, the Arduino has to be programmed prior to installing the RS232 shield. The following program was uploaded, the RS232 shield installed and the Sensor was wired to pin 7, +5 volt and ground. // Modified Program to read Parallax PING))) sensor// Send time ultrasound travels to objectconst unsigned int pingPin = 7;const unsigned int baudRate = 9600;void setup(){ Serial.begin(baudRate);}void loop(){ pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(5); digitalWrite(pingPin,LOW); pinMode(pingPin, INPUT); const unsigned long duration = pulseIn(pingPin, HIGH); if (duration == 0) { Serial.println(0); }else { Serial.println(duration); } delay(25);} The program can be tested by reading the input with a terminal program or the Arduino IDE through an RS232 port. Or, remove the shield and wire up the sensor, then read the data through the USB port. The ATARI side The first thing you may want to do is connect the Arduino to the 850 and read the data stream using a terminal program on your 8 bit. Be sure to set the baud rate at 9600. The BASIC program was derived from an example in the 850 manual. Appendix 9 – User Programs, 5. Reading a Digitizer: More Input Than BASIC Can Handle (Page 77-78). The Arduino is programmed to continuously send data to a buffer. The Atari asks for input slower then it is being placed in the buffer. When the buffer is full the Arduino overwrites the data. To keep the buffer in sync with the Atari, a double input method is used in line 100. Read the buffer the first time to empty it and then the second time retrieves the latest reading. (I recommend finding a copy of the manual to read.) The first test program reads the data from the Arduino and prints out the text input and the value. Getting the SS$ into a floating point variable was a little more involved then INSS = VAL(SS$). The first problem was that a graphic character (CHR$(10)?) was placed at the beginning of the data. Not sure where it came from but it needed to be ignored. The second was knowing where the string ended. Line 105 and 110 were used to take care of this problem (most of the time). 10 DIM SS$(10):REM holds input from sound sensor20 XIO 36,#1,15,0,"R1:":REM set baud30 OPEN #1,5,0,"R1:":REM open port40 XIO 40,#1,0,0,"R1:":REM start I/O100 INPUT #1,SS$:INPUT #1,SS$:REM clear buffer,get reading105 X=LEN(SS$):REM Length of text string110 INSS=VAL(SS$(2,X)):REM convert text to floating point120 ? SS$,INSS:REM print data to screen130 GOTO 100:REM do it again Now it was a matter of scaling the INSS variable for the SOUND command. That was easy but…….. it was not expected that the SOUND would turn off when the INPUT command was executed . I tried a few things to see if it would stay on but to no avail. This listing is just the last iteration that was tried. 10 DIM SS$(10)20 XIO 36,#6,15,0,"R1:"30 OPEN #6,5,0,"R1:"40 XIO 40,#6,0,0,"R1:"100 INPUT #6,SS$:INPUT #6,SS$102 CLOSE #6105 X=LEN(SS$)110 INSS=VAL(SS$(2,X))120 ? SS$,INSS125 SOUND 3,INSS/31,10,10126 FOR Y=1 TO 100:NEXT Y130 GOTO 30 This last program simply uses a simple calculation to estimate the distance from the sensor to the object. It might come in handy for a security system or if you’re building a robot with an Atari brain. It was noted that every so often a string length error would occur. I would bet that when this happened the string variable SS$ was empty causing a length error when trying to read SS$(2,0). This was solved with the TRAP 100 command. Anytime an error occurred it would try again. 10 DIM SS$(10)20 XIO 36,#6,15,0,"R1:"30 OPEN #6,5,0,"R1:"40 XIO 40,#6,0,0,"R1:"100 INPUT #6,SS$:INPUT #6,SS$102 TRAP 100105 X=LEN(SS$)110 INSS=VAL(SS$(2,X))120 ? INSS/29/2;" CM"126 FOR Y=1 TO 100:NEXT Y130 GOTO 100 In hindsight I might have started with a lower baud rate and picked another sensor. Optimization of hardware and software will have to wait for another day and another project. Reference: Analog Computing Pocket Reference Card, The, Analog Computing Magazine, 1985 Atari DOS 2.5: 1050 Disk Drive Owner’s manual, Atari Corp. 1985, CO72033-001 Rev. A. Atari 850 Interface Module Operator’s Manual, Atari, Inc. 1980, CO15953 Rev. 1 Poole, Ion, Your Atari Computer, OSBORNE/McGraw-Hill 1982 Schmidt, Maik, Arduino: A Quick-Start Guide, Pragmatic Programmers, LLC. 2011. (Page 87-93)
  6. Lately I've been working on interfacing an Arduino to the cartridge port of the TI-99 in an attempt to emulate a GROM. The Arduino has functions for reading data, along with reading and writing to/from the GROM address, and it is programmed to handle the GROM select, mode, and direction lines, along with the address/data bus. However, upon inserting the cartridge that connects to the Arduino and powering up the system, it doesn't manage to move past the point at which the sound chip is turned off at the beginning of the boot process. After a few hours of troubleshooting, I am still unable to find a cause for the problem. What are some the reasons that a problem like this might occur? Thanks!
  7. hello i've been searching around on the web but havent found a definitive answer, i know that it's possible to get a 1 - 2 Mhz "clock" by toggling an arduino pin, but would it be possible to genrate the 3.579545 Mhz since you can actually display a composite output using the arduino tv out library? the project is pretty much a general sound and video synth, just to see how much more one could get out of a TIA chip by removing it from the limiting memory map/configuration of the 2600, aswell as having the more oomph power of the arduino at 16mhz, could one generate the clock and still have enough cpu(arduino) cycles to actually do useful stuff. P.s is it possible to use 2 74hc595 one for the addressing and the other for the data bus on the tia, or are the signal timings that precise?
  8. I was going to start writing my list of resolutions for 2018. Then I thought about writing about what I didn't accomplish in 2017. Then I decided to just work on programing the interface and get the Atari to read and print the MIDI data stream through the joystick port. I had high hopes of creating a midi monitor that would accept the data and print out the commands as they were received but all that extra code was getting in the way of finding errors. I was happy when I got the Atari8 and Arduino to just reliably print the correct bytes. A SIO cable was to be modified because the SIO2PC dead-ends the SIO chain. I just attached jumper wires with female ends to the 4th and 8th pins on a standard cable. Saved me a lot of plugging and unplugging. I wasn't looking forward to programming the Arduino and Atari 8 because trouble shooting was going to be a painful endeavor. Was it the interface hardware, the Arduino program or the Atari8 program that is the problem. Yes, I had problems with all three and even created more. The Arduino Program. The Arduino performs the following steps. 1. Reads the midi data stream and puts it into a buffer. Continuously. 2. Gets a bit from the buffer. FIFO 3. Sets control pins for the 8 joystick pins 4. Sets trigger to signal that data is ready to be read 5. Waits for Atari to signal it got the data 6. Sets the trigger to signal data not ready 7. Waits for Atari to signal reset the process to step 2. Its simple, when you remember that the logic from the Arduino is inverted. When a pin on the Arduino is set high the transistor in the optocoupler turns on, shorting the pin to ground. Thus making the logic level, read by the Atari, LOW. /* Midi data transfer test 12/2017 * * This program reads midi data then ouputs * the data to the Atari Joystick ports. * * The use of the control lines to the Atari Trigger * and from the cassette motor control line on the SIO * port are used for data flow control. * */ // Atari PORTA(54016) mapped to pins on arduino int porta0 = 4; int porta1 = 5; int porta2 = 6; int porta3 = 7; int porta4 = 8; int porta5 = 9; int porta6 = 10; int porta7 = 11; int DSR = 3; //data set ready int DTR = 12;//Atari ready byte zero = 0; byte tempX = 0; int midiData = 0; //Function to Send a byte to the atari and void sendByte(byte byteToSend){ setPorta(byteToSend); digitalWrite(DSR,LOW); //data ready-Trigger 0 while(digitalRead(DTR) == LOW){} //Wait for Atari to get byte cmc goes low digitalWrite(DSR,HIGH); //data not ready-trigger 1 while(digitalRead(DTR) == HIGH){} //wait for Atari to signal ok to get next byte } void setPorta(byte byteToMap){ // Sets digital pins to transfer data to Atari joystick ports(PORTA) // When digital port high, joystick pin shorted to ground or logic 0 if (byteToMap & B00000001){digitalWrite(porta0,LOW);} else {digitalWrite(porta0,HIGH);} if (byteToMap & B00000010){digitalWrite(porta1,LOW);} else {digitalWrite(porta1,HIGH);} if (byteToMap & B00000100){digitalWrite(porta2,LOW);} else {digitalWrite(porta2,HIGH);} if (byteToMap & B00001000){digitalWrite(porta3,LOW);} else {digitalWrite(porta3,HIGH);} if (byteToMap & B00010000){digitalWrite(porta4,LOW);} else {digitalWrite(porta4,HIGH);} if (byteToMap & B00100000){digitalWrite(porta5,LOW);} else {digitalWrite(porta5,HIGH);} if (byteToMap & B01000000){digitalWrite(porta6,LOW);} else {digitalWrite(porta6,HIGH);} if (byteToMap & B10000000){digitalWrite(porta7,LOW);} else {digitalWrite(porta7,HIGH);} } void setup() { pinMode(porta0,OUTPUT); pinMode(porta1,OUTPUT); pinMode(porta2,OUTPUT); pinMode(porta3,OUTPUT); pinMode(porta4,OUTPUT); pinMode(porta5,OUTPUT); pinMode(porta6,OUTPUT); pinMode(porta7,OUTPUT); pinMode(DSR,OUTPUT); pinMode(DTR,INPUT); Serial.begin(31250); setPorta(zero);// digitalWrite(DSR,HIGH); } void loop() { if (Serial.available()>0){ midiData = Serial.read(); //read MIDI stream tempX = byte(midiData); sendByte(tempX); //Send to Atari } } The Atari Program When the Atari wants data it checks the trigger button to see if there is any to read. If not, this program simply waits for one to show up. 10 GOSUB 29000:REM SET UP VARIABLES 15 POKE PACTL,CMCOFF:REM CAS.OFF 20 IF STRIG(0)=0 THEN GOTO 20:REM WAIT ARDUINO TO SIGNAL DATA READY 30 MIDIDATA=PEEK(PORTA):REM READ 35 ? MIDIDATA;" ";:SOUND 0,200,15,15:SOUND 0,0,0,0:REM SHOW DATA ON SCREEN 40 POKE PACTL,CMCON:REM GOT DATA 60 IF STRIG(0)=1 THEN GOTO 60:REM ARDUINO BUSY GETTING DATA 70 POKE PACTL,CMCOFF:REM TELL ARDUINO TO HOLD DATA UNTILL READY 80 GOTO 20:REM GO WAIT FOR NEXT BYTE TO BE READY 29000 PORTA=54016:REM STICK 0 AND 1 29020 PACTL=54018:REM PORTA CONTROL 29030 CMCON=52:REM CASSETTE MOTOR ON 29040 CMCOFF=60:REM CAS. MOTOR OFF 29050 REM POKE 559,0:REM TRUN OFF SCREEN 29100 RETURN A Casio Keyboard was attached to the interface and data was sent to the Atari and dumped on the screen. The following screen shot shows three 255s that were produced when the Arduino was turned on and the reset button was pushed twice. Then anytime a key was pressed or released a NOTE ON command on channel 0 (144) was sent. You see the 144 then the MIDI key number and then the volume setting. If a volume setting was 0 the key was released. The keyboard is not pressure sensitive so its volume defaults to 100. I didn't see any data being missed by the Atari but it was so slow. I mean, it make 300 baud seem fast. I mean, it was so slow that I tried to turn off the display. I mean, it was soooooo slooooooow that I thought I would have to get out the M65 cartridge. Instead, the program was compiled using the MMG Compiler. The speed improvement was remarkable. I couldn't get the buffer to over flow even when a bunch of keys were pressed and released. Since the digital horn is monophonic, its data output should be manageable even when it is transmitting the breath pressure(after touch) data. I also took the time to load the compiled program onto a Max Flash cartridge. Easily running these programs on computers with out a monitor and disk drive will simplify the hardware setup significantly. There was a problem when the Arduino was powered up, all the joystick pins were reading LOW. This confused the Max Flash menu and the program didn't load when the return was pressed. Pressing the Reset button on the Arduino resets the pins until they are turned off again by void Setup() function and hitting the return key on the Atari before that happens will run the program. Now on to writing the program that actually makes some noise and maybe a little music.
  9. Back in January of 2015, I wanted of use a PING)) ultrasonic sensor to measure distance and send it to the Atari using the 850 - RS232 ports. I initially thought that I could move my hand in front of the sensor and the resulting change in desistance could be used to change the frequency of the sound command. This might have worked if the SIO port could be used to make sound .AND. transmit data to the 850 interface at the same time. It doesn't. So, I forgot about the sound and just got the distance data to the Atari and wrote up the blog entry. Now that the Arduino Uno to PORTA shield (AU2PORTA) is at my disposal, I can bypass the SIO port and receive the data through the Joystick ports to control the sound frequency. The Arduino reads the sensor data, scales it from 0 to 255, and sets the joystick pins. The Atari simply PEEKs the memory for PORTA and sets the SOUND command. -------------------------------------------------------- Hardware setup - Plug the AU2PORTA shield into the Arduino UNO. Connect the PING)) sensor to the Shield. PING)) ------- Arduino GND GND 5V 5V SIG D2 Plug the AU2PORTA joystick cables into the correct Atari joystick port. Arduino UNO program - /* This Arduino program receives data from a PING))sensor. Then scales the reading to an 8 bit number. That number is send to the Atari Joystick ports using the AU2PORTA shield. Pitch data is also sent to the Arduino IDE serial monitor for troubleshooting. PING))code example used to read sensor (Examples/06.Sensors/Ping) Kevin Packard January 2019 */ // Atari PORTA(54016) mapped to pins on arduino int porta0 = 4; int porta1 = 5; int porta2 = 6; int porta3 = 7; int porta4 = 8; int porta5 = 9; int porta6 = 10; int porta7 = 11; int trig1 = 3; const int pingPin = 2; PING)) //sensor data pin byte pitch = 0; byte lastPitch = 0; byte zero = 0; void setPorta(byte byteToMap){ // Sets digital pins to transfer data to Atari joystick ports(PORTA) // When digital port high, joystick pin shorted to ground or logic 0 if (byteToMap & B00000001){digitalWrite(porta0,HIGH);} else {digitalWrite(porta0,LOW);} if (byteToMap & B00000010){digitalWrite(porta1,HIGH);} else {digitalWrite(porta1,LOW);} if (byteToMap & B00000100){digitalWrite(porta2,HIGH);} else {digitalWrite(porta2,LOW);} if (byteToMap & B00001000){digitalWrite(porta3,HIGH);} else {digitalWrite(porta3,LOW);} if (byteToMap & B00010000){digitalWrite(porta4,HIGH);} else {digitalWrite(porta4,LOW);} if (byteToMap & B00100000){digitalWrite(porta5,HIGH);} else {digitalWrite(porta5,LOW);} if (byteToMap & B01000000){digitalWrite(porta6,HIGH);} else {digitalWrite(porta6,LOW);} if (byteToMap & B10000000){digitalWrite(porta7,HIGH);} else {digitalWrite(porta7,LOW);} } void setup() { pinMode(porta0,OUTPUT); pinMode(porta1,OUTPUT); pinMode(porta2,OUTPUT); pinMode(porta3,OUTPUT); pinMode(porta4,OUTPUT); pinMode(porta5,OUTPUT); pinMode(porta6,OUTPUT); pinMode(porta7,OUTPUT); pinMode(trig1,OUTPUT); setPorta(zero); Serial.begin(9600);// } void loop() { long duration; // from Ping example pinMode(pingPin, OUTPUT); digitalWrite(pingPin, LOW); delayMicroseconds(2); digitalWrite(pingPin, HIGH); delayMicroseconds(5); digitalWrite(pingPin, LOW); pinMode(pingPin, INPUT); duration = pulseIn(pingPin, HIGH); // if(duration < 200 || duration >3500){duration = 200;} // duration 200 us note off pitch = map(duration,200,3500,0,255); // Scale duration for Atari pitch setting if(pitch != lastPitch){ // look for pitch change from last setting digitalWrite(trig1,HIGH); // let atari know not to read pitch while port is being set setPorta(pitch); // set pins with pitch data digitalWrite(trig1,LOW); // let atari know data ok to read lastPitch = pitch; // store latest pitch Serial.print(pitch); // display pitch in Serial Monitor window(if connected) Serial.println(); } delay(100); // delay for PING)) and atari to sync. }// End of Listing Atari BASIC code example - 100 IF STRIG(0)=0 THEN 100 200 PITCH=PEEK(54016) 210 IF PITCH=255 THEN VOLUME=0 220 IF PITCH<>255 THEN VOLUME=10 300 IF PITCH=LASTPITCH THEN 100 400 SOUND 0,PITCH,10,VOLUME 500 LASTPITCH=PITCH 510 ? PITCH 600 GOTO 100 While the programs are running, you should be able to move your hand (or other sound reflective object) closer and further from the PING)) sensor to hear a change in pitch.
  10. Over the years I've been using an Arduino UNO to setup data for transfer to the Atari Joystick ports. The first attempt was to read the data from a Wii nunchuk and translate it to joystick movements. Lately I've been experimenting reading midi data using an Arduino Midi Shield, along with using the Cassette Motor Control pin on the SIO port as feedback to the Arduino. You may have read some of these blogs. During the "Switched On POKEY" music experiments, there were many modifications tried and some were put off for later evaluation. At first the cassette motor control(CMC) pin on the SIO was used to signal the Arduino. Then bit 7 of PORTA(joystick) was set as output and trigger 2 was set and used for bit 7 input. It worked but didn't solve a click problem I thought I was having when switching the CMC. MIDI setup then and now: It seemed time to gather my thoughts and solder together a prototype shield. And to, establish a point of reference for beginning future experiments. From now on I will refer to this Arduino Uno shield as AU2PORTA. This shield will be able to set the joystick direction pins (PORTA) and the 2 triggers. With 1 bit output from the Atari's CMC pin, wired to be used to signal the Arduino when needed. The parallel data transfer used most of the digital lines. D0 and D1 are used for serial communication with the MIDI shield (or computer) leaving D2 free for other uses. The Analog signal lines are still avalible for analog input, I2C devices or reading voltages of digital logic signals. The ground for each of the joysticks are separate. This allows the shield to be hooked up to a joystick port of different computers and maintain separate grounds. This might come in handy someday. The circuits use 11 optocouplers (PS2501). Some people may think I am being overprotective of my Atari computers but I prefer to think of it as being very protective of my computers. These isolators will keep the Arduino and Atari circuits from harming each other, no matter what gets hooked up to the Arduino. Note: The prototype circuit uses the PS2501 for CMC feedback bit and worked. I grabbed a PS2502-1 optocoupler from the parts bin while building the shield. The PS2501 has one transistor while the PS2502 has two in a Darlington configuration. They both work. The next shield that gets built will use a PS2501-1. The shield was soldered and tested using the following Arduino program that set all the digital pins HI and then LOW. *The Arduino toggles the pins wired for the Atari to read. * *The CMC circuit is not tested. * */ // Atari PORTA(54016) mapped to pins on Arduino int porta0 = 4; int porta1 = 5; int porta2 = 6; int porta3 = 7; int porta4 = 8; int porta5 = 9; int porta6 = 10; int porta7 = 11; int trig1 = 3; int trig2 = 12; int digPin=0; void setup() { pinMode(porta0,OUTPUT); pinMode(porta1,OUTPUT); pinMode(porta2,OUTPUT); pinMode(porta3,OUTPUT); pinMode(porta4,OUTPUT); pinMode(porta5,OUTPUT); pinMode(porta6,OUTPUT); pinMode(porta7,OUTPUT); pinMode(trig1,OUTPUT); pinMode(trig2,OUTPUT); } void loop() { for (digPin = 3; digPin<13; digPin++) { digitalWrite(digPin,HIGH); } delay(200); for(digPin = 3; digPin<13; digPin++) { digitalWrite(digPin,LOW); } delay(200); } Then when the Arduino and Shield are hooked up to the joystick ports this next small Atari BASIC program was used to read the trigger and joystick. 15 means all Arduino controlled digital pins are LOW. 0 for all HIGH. Triggers; Arduino is HIGH and Atari reads 0.(Note the reverse logic. Arduino - LOW/Atari - HIGH. Very important when programing) 10 ? STICK(0),STRIG(0),STICK(1),STRIG(1):LAST = STRIG (0) 20 IF STRIG(0)=LAST THEN 20 30 GOTO 10 Once the 3 bad solder connections were fixed, the following program was used to toggle the Cassette Motor control on the SIO port. A Volt meter was used to read the voltage drop across the 1K resistor as it was switched. Atari HIGH - Arduino HIGH. 10 POKE 54018,52:REM TURN ON CMC 20 FOR X=1 TO 200:NEXT X 30 POKE 54018,60:REM TURN OFF CMC 40 FOR X=1 TO 200: NEXT X 50 GOTO 10 The next task is to optimize the data transfer routines and resolve problems that are caused by the reverse pin logic and the startup logic defaults.
  11. After hearing Computer Blues through a MIDI synthesizer, I can understand how some parents feel while hearing their child's first recital. Its not so much listening to the music as it is hearing the potential. It is in this spirit that I post these zipped sound files. Atari computer blues 8.m4a - the original sound from the A8 with 8 as the speed Midicb piano.m4a - recorded the Casio CKT-481 synth at speed 1 Midich organ.m3q - Organ sound Midich organ and drum - Organ with drum pattern. computer blues.zip Download this for the .ATR of the A8 files and the Arduino sketch. MIDI CB - program .zip The technical side: I wanted to make as few changes to the original program as possible. Follow along with a listing of the program CBMIDI2.BAS. 1000-1050 Data statements were converted from Atari pitch values to MIDI Note numbers. 9 consolidate lines 1-6 and move 8 to 15. Free up some line numbers at beginning of program. 1 REM program title information. 2 GOSUB 3000 sets up RS232 port for output to Arduino. 3000 Open R2: at 9600 baud - no translation 2500 Send MIDI command data subroutine Replace SOUND command with data setup and call to 2500 subroutine NOTE ON: 260 CMD=144:MIDINOTE=JAM(CHORD,NT),VELOCITY=NT*10+65:GOSUB 2500 535 CMD=144:MIDINOTE=LOW(CHORD):VELOCITY=60:GOSUB 2500 540 CMD=144:MIDINOTE=BASE(CHORD,THNOT):VELOCITY=60:GOSUB 2500 NOTE OFF: 700 CMD=128:MIDINOTE=LOW(CHORD):VELOCITY=0:GOSUB 2500 710 CMD=128:MIDINOTE=BASE(CHORD,THNOT):VELOCITY=0:GOSUB 2500 At this point the Computer Blues music was recognizable, although slow. The synth is able to play up to 16 notes at a time. This allowed 14 melody notes (+2 for the base) to be playing at the same time. When the 15 note was added the first note would tuned off. The following line was added to turn off the melody note before playing the next. Once in a while you'll notice that a note duration seems to be shortened. When the LASTNOTE = MIDINOTE, line 265 will turn off the melody note that was just started in line 260. This little quirk didn't degrade the song quality and may perhaps improved it. 265 CMD=144:MIDINOTE=LASTNOTE:VELOSITY:0:GOSUB 2500:LASTNOTE=JAM(CHORD,NT) The original goal of this project has been reached. It is possible to write Atari BASIC programs that can output MIDI data to a MIDI device, if you have an 850 and an Arduino with RS232 in/MIDI out. The speed of BASIC and the 850 interface will definitely impact most results. Trying to optimize the Atari BASIC code should increase its functionality. Then you also have to ask what happens when you let the Arduino do some of the work? Of course you could port Computer Blues directly into the Arduino, but where's the fun in that? Links to the two proceeding blogs The Hardware http://atariage.com/forums/blog/572/entry-13269-midi-computer-blues-setting-up-the-hardware/ Testing the Hardware. http://atariage.com/forums/blog/572/entry-13277-midi-computer-blues-note-on-note-off/
  12. I've seen USB adapters for connecting Atari 2600 paddle controllers to a PC, but what about connecting USB optical mice to a real Atari to use as paddles? I'm interested in trying a regular wired USB optical mouse or PC wired USB optical trackball for controlling paddle games - not only would it give a different gaming experience than paddles, but optical controllers would also be "jitter proof". I have already made my own spinner controllers for MAME and Stella on the computer very simply, by duct-taping an optical mouse against a shaft (such as a wood dowel, or a wood dowel through a section of foam pool noodle) connected to a knob, and it works beautifully. So I am curious about making an adapter using an Arduino or Raspberry Pi or similar, that you can plug the mouse into, and outputs the variable resistances that would emulate a real paddle controller on the 2600. (The paddle button would be a simple matter of wiring the button to the appropriate pins.) Has anyone tried this, seen a page on this, or got any idea how a microcontroller might output the resistance range (1M ohm) that a native 2600 paddle controller would?
  • Create New...