Jump to content

k-Pack

Members
  • Posts

    323
  • Joined

  • Last visited

Everything posted by k-Pack

  1. At some point during the writing of the last blog entry it dawned on me that accessories could be written to toggle the logic output for the joystick port from within any Diamond application that uses the drop down menu. Six machine language programs were developed to do just that. JSP1OUT.APP Application to set the joystick port 1(JSP1) to output. JSP1IN.APP Application to set JSP1 for input. JSP1P1.ACC – JSP1P4.ACC Accessories to toggle the pins on and off when loaded during boot up. Down load this video to view the programs in action. dControl acc.wmv As you can see by the MAC/65 listings that these files are small. Just be aware that they were written to control JSP1 while using JSP2 for mouse input. Small is a good thing when writing accessories. Only 6 .ACC flies can be loaded at one time and there is 300 bytes reserved for their use. JSP1OUT.APP - This program sets the JSP1 PIN1-4 as outputs. Then sets the output values to 0. The jump to Diamond function #48 returns you to the Diamond desktop. 1000 ;PROGRAM TO SET UP THE JOYSTICK1010 ;PORT FOR OUTPUT TO BE1020 ;CONTROL BY DIAMOND.ACCs1030 ;1040 ; BY PACK007 V1.0 JUNE 20151050 ;1060 .OPT NO LIST1070 PORTA = $D3001080 PACTL = $D3021090 DIAMOND = $8E001100 ;1110 *= $30001120 ;1130 START LDA #481140 STA PACTL1150 LDA #151160 STA PORTA1170 LDA #521180 STA PACTL1190 LDA #01200 STA PORTA1210 LDA #48 ;DIAMOND FUNCTION1220 JSR DIAMOND1230 ;1240 *= $02E01250 .WORD START JSP1IN.APP – Sets the JSP1 pins to inputs. No need to reset the logic levels . 1000 ;PROGRAM TO RESET JSP11010 ;FOR INPUT 1020 ;1030 ;1040 ; BY PACK007 V1.0 JUNE 20151050 ;1060 .OPT NO LIST1070 PORTA = $D3001080 PACTL = $D3021090 DIAMOND = $8E001100 ;1110 *= $30001120 ;1130 START LDA #481140 STA PACTL1150 LDA #01160 STA PORTA1170 LDA #521180 STA PACTL1190 LDA #48 ;DIAMOND FUNCTION1200 JSR DIAMOND1210 ;1220 *= $02E01230 .WORD START JSP1P1 to JSP1P4.ACC – Toggles the appropriate pin on and off. Writing accessories is a bit more complicated due to Diamond’s need for some header information in order to add the program to the drop down menu. It also needs to know where put the program in memory and its length. SKELETON.M65 is setup to organize this information in the required order while assembling an .OBJ file. This .OBJ file is then read by the MAKEACC.APP, manipulated, and then written as an accessory (.ACC). JS1P1 is listed. There are but two lines to change for the other pins. Line 1130 contains the 10 Character title. Line 1210 uses the bit value 1, 2, 4, and 8 for pins 1 – 4 of JSP1. 1000 ;ACC TO TOGGLE OUTPUT ON PIN 11010 ;Of JSP11020 ;1030 ;PACK007 V1.0 JUNE 20151040 ;1050 ;Start with SKELETON.M651060 ;for Desk Accessories1070 ;1080 .OPT NO LIST1090 ;1100 ;1110 *= $2FF01120 ;1130 .BYTE "PIN 1 " ;10 Byte Name1140 .WORD ENDACC ;End of Accessory1150 .WORD 01160 .WORD RUNACC ;Run Address1170 ;1180 ;ACCESSORY VARIABLES1190 ;1200 RUNACC1210 LDA #1 ; PIN BIT VALUE1220 EOR $D300 ;PORTA1230 STA $D300 ;PORTA NEW VALUE1240 RTS1250 ENDACC One possible use for these pins is suggested in this “Out of the Pack” blog entry. http://atariage.com/forums/blog/572/entry-11626-relay-boards-under-atari-8bit-control/ References: Chadwick, Ian, Mapping the Atari, Compute! Books, 1985 Chasin, Mark, Assemble Language Programming for the Atari Computer, A Byte Book, 1984 Diamond Develop User Manual, Third Addition, Reeve Softs, 1991 Lawrow, Stephen D., Mac/65 reference manual For Atari, Optimized System Software, 1984 Mansfield, Richard, Machine Language For Beginners, Compute! Books, 1983
  2. ANSWER: Yes, you can use an Atari mouse plugged into port 1 while using the digital pins on port 0 as outputs while operating in the Diamond GOS environment. The answer was needed because I’ve been thinking about writing the control software for some hardware projects to work under the Diamond GOS. As a test, this short program was written to randomly set the outputs to control the LEDs in the Joystick Port Logic Box (JPLB). (See “Out of the Pack” Blog 4/20/2015) This BASIC program sets up Diamond so that the mouse can be moved around. When the mouse is clicked a random number between 0 and 15 is used to set the pin’s logic state as indicated by the JPLB connected to port 0. When a key on the keyboard is pressed the program exits Diamond and returns you to the READY prompt. 5 REM DIAMOND - PORTTEST.BAS 5/19/2015 10 REM TEST PROGRAM TO SEE IF DIAMOND MOUSE STILL WORKS ON PORT 1 WHEN PORT 0 IS USED FOR OUTPUT 20 REM 100 REM SETUP JOYSTICK PORT#1 (PORT0) FOR OUTPUT 110 POKE 54018,48 120 POKE 54016,15 130 POKE 54018,52 140 POKE 54016,0 149 REM LOAD PAGE 6 DIAMOND LINK 150 CLOSE #1:OPEN #1,4,0,"D:DIABASIC.OBJ":TRAP 180 155 GET #1,A:GET #1,B:GET #1,C:GET #1,D 160 IF A<>255 OR B<>255 THEN 170 165 A=C:B=D:GET #1,C:GET #1,D 170 FOR X=A+B*256 TO C+D*256:GET #1,Y:POKE X,Y:NEXT X 175 GOTO 155 180 W0=1539:W1=1541:W2=1543:W3=1545 182 W4=1547:W5=1549:W6=1551:W7=1553 184 B0=1555:B1=1556:B2=1557:B3=1558 186 B4=1559:B5=1560:B6=1561:B7=1562 188 EVENTTYPE=39571:DIAMOND=1536 200 REM INITILIZE DIAMOND 210 POKE B0,0:X=USR(DIAMOND,0) 300 REM GET EVENT TYPE 310 X=USR(DIAMOND,23) 320 IF PEEK(EVENTTYPE)=0 THEN 310:REM NO EVENT 330 IF PEEK(EVENTTYPE)=5 THEN 400:REM BACKGROUND 340 IF PEEK(EVENTTYPE)=4 THEN 500:REM KEYPRESS 350 GOTO 310 400 REM BACKGROUND EVENT - SEND OUTPUT TO PIN 410 FOR X=1 TO 10:SOUND 0,100,14,8:NEXT X 415 POKE 54016,INT(RND(0)*16) 420 SOUND 0,0,0,0:GOTO 310 500 REM EVENT KEYBOARD - QUIT 510 X=USR(DIAMOND,1) 600 STOP Line 100-140 Sets the port 0 for output and leaves port1 for mouse input. Diamond does not reset the port settings when initialized. It was also noted that JPLB showed that the logic outputs did not change when the BASIC program was stopped or when going back to the Diamond Desktop. Joystick port operations should be reset before the program ends. The ports will also reset for input if the RESET key is pressed, although you will more than likely have to reboot to use Diamond again. Line 150-188 This part of the program loads in the machine language program that links the Diamond cartridge routines to BASIC. This is a shortened version of the original code, the line numbers were changed and the Diamond routine number definitions were removed. You’ll need a copy of DIABASIC.OBJ on the specified drive. Line 210 Initializes the Diamond in High Rez mode. It’s a blank screen with a mouse pointer to move around. Line 300-350 Checks for an EVENT. No event keep checking. A click of the mouse will change logic levels of port 0. Pressing a key on the keyboard will exit the program. Line 400-420 Makes a sound to let you know the number changed. A new random number (sometimes the same number) is picked and sent to port 0 for output. Then the sound is turned off. Then back to check for next event. Line 500-600 Exits the Diamond environment and STOPs the program. It is a good idea to use the quit function to exit Diamond. It can clean up memory and turn off the player graphics used for the mouse.
  3. 2600 Remote Control Joysticks - $45 includes domestic shipping No manual. 9V Batteries not included. Works as well as they ever did. Tested with Pocket Joystick Tester. PM if interested.
  4. Its hard to work out the spec when your parts are coming out of a junk draw. I measured the current at 23mA at 3V for one LED.. That is less then 70 mW. Before building the circuit I tested the LEDs at 3V and they did not burn out or get warm to the touch. Under normal use, I wouldn't think that the LEDs would be drawing current for an extended length of time. The battery is rated for 180 mAh. The resistors would increase battery life but didn't consider that to be a major concern.
  5. Have you ever been in a situation where you wished you could check your joystick but your Atari game system or computer was not within reach? Maybe you’re at the flea market looking for a joystick. Maybe you’re at your work bench. Maybe you want to check out the broken joystick that your friend gave you to play with. Whatever the case, now you can build this portable pocket joystick tester to carry where ever you go. As projects go, they don’t get any simpler. The bigger you make the circuit, the easier it will be to put together. It would be easy to modify an old joystick circuit board. You will just have to drill some holes. I had a case, about the size of a remote car starter, left over from the last project. NOTE: The photos were taken before troubleshooting was done. Refer to schematic for proper wiring. My parts list 5-ea. - LEDs (Jameco assorted pack 18041 - tested at 3 volts) 1-ea. – DB9 male connector (Jameco 15748) 1-pcs. – Prototyping Board cut from (Jameco 2191470) 1-ea. – CR2032 Battery (Rite Aid) 1-ea. – CR2032 Battery Holder (RadioShack 270-009) 1-ea. – Case 2 X 1.125 X 0.5” (Jameco 675331) Connection wire from ribbon cable (from dumpster dive) Nonconductive foam (Kindle leather case packaging insert) Of course no project is complete without a troubleshooting story. After building the circuit and putting it in the case I plugged in the joystick. The UP LED didn’t light and the others were out of order. Opened up the case and found that I had wired the connector pins to 5 to 2 instead of 1 to 4. Fixed the problem and put it back in the case. Everything worked fine except the UP LED. Opened up the case and found one of the wires had been cut when closing the case. Fixed the problem and put it back in the case. Everything worked find except the UP LED. Just before I opened the case again I tried another joystick. The problem went away. I had found my first joystick in need of repair. Be forewarned that it may not detect an auto-fire trigger and when you are at the flea market, remove the tester from your pocket before you plug in the joystick
  6. Thanks for the new project Idea. A pocket size portable Joystick checker. I'll never again go to a flea market without one.
  7. Not that many of my projects get past the prototype stage. Once I find out that something can be done I rapidly lose interest. I have found in the past that once built, the circuits rarely get used because Im working on the next project. But every so often a circuit gets soldered together and put in a project box to have on hand. Such is the case with the Joystick Logic Box. While programing the Spinax light control circuit I wished I had the ability to quickly hook up some LEDs to the Joystick pins to view their logic state as they were changing. With the LEDs hooked up I would be able to get the program working without having to wonder if the circuit or the program is causing problems. So, before I start my next project wishing I had this little tool at my disposal, I built one using a perforated prototype board and solder and put it in a small project box. The electronics is nothing revelatory but I was surprised that it went into a project box measuring 1.25 X 2 X 0.5 using through hole components. It would also surprise me if someone has not done this before. Joystick Logic Box You may have to resize R5-R8 depending on the LED you use. A DB9 female connector was mounted on the box to allow a joystick extension cable to connect the computer and box. The Spinax light control program can be used to test the LEDs. http://atariage.com/forums/blog/572/entry-11864-light-control-hardware-spinax-part-003/ They should all be on when you boot up and start blinking on pins 1, 2 and 3 when the program runs. Now Im ready for that next project.
  8. 1 Lot - 17 Issues of Current Notes $35 + shipping from Niagara Falls, NY Weight = 8 lb. Current Notes - Helping Atari Owners Through the World of Computting Vol. 12, No.8 October 1992 Vol. 13, No.2 March 1993 Vol. 13, No.3 April 1993 Vol. 13, No.4 May 1993 Vol. 13, No.5 June 1993 Vol. 13, No.6 July/August 1993 Vol. 13, No.7 September 1993 Vol. 13, No.8 October 1993 Vol. 13, No.9 November 1993 Vol. 13, No.10 Dec93/Jan94 Vol. 14, No.1 February 1994 Vol. 14, No.2 March 1994 Vol. 14, No.3 April 1994 Vol. 14, No.5 Jun/Jul 1994 Vol. 14, No.6 Aug/Sep 1994 Vol. 14, No.7 Oct/Nov 1994 Vol. 15, No.2 Mar/Apr 1995
  9. k-Pack

    DATA COUP

    Looking through some disks I found some more unfinished business from around 1993. I had been writing articles for the Western New York Atari User Group (WNYAUG) newsletter, POKEY, for a couple of years before I started running out of things to write about. The newsletter was a good place to hone my writing skills and decided to try my hand at fiction. The story, “Data Coup” was written as a serial to appear in POKEY over 5 issues. The first chapter was published in the last paper edition. Then I found chapter 3 on a monthly disk issue. Then the group stopped publishing its own newsletter. I don’t think anyone got to read 2, 4, and 5. So here is your chance. As you read them please remember: 1 “Data Coup” was written in 1993. 2. The story line developed as I wrote each chapter. Each chapter was written in an evening. 3. The Atari ST - Word Perfect files needed considerable work to get them into a readable format. A few spelling errors were corrected and a couple of “then”s were changed to “than”s, but for better or worse it is the same story. 4. This was an experiment to see if I could write fiction. 5. It was never fully published. 6. This has been my only attempt to write fiction. 7. Don’t attempt to read this while operating a motor vehicle. DACO_001.pdf DACO_002.pdf DACO_003.pdf DACO_004.pdf DACO_005.pdf
  10. The control system for the lights on LEGO’s Spinax has been prototyped and programed for a simple sequence. If your only interest is to see it in operation, check out the link to the YOUTUBE video. If you want more information read on. {video removed} Spinax has 8 lights along its back. I wanted to be able to program the on/off cycles for each light. This could be done using the 8 digital outputs of the joystick ports but left little room for future expansion. Instead three digital output pins were used to send data to a shift register chip, leaving the other 5 free for future additions. This method of serial data transfer is described well in Your Atari 8-bit Comes Alive by Richard C. Leineker. You can obtain a copy at atarimania.com. The book uses chip 74164 which is referred to as an 8-Bit Parallel-Out Serial Shift Register in Texas Instrument Data Book. The chip requires a clock line and data line for the data transfer and will set the outputs as the data is received and shifted. Previous experience with the 74LS595 (8BIT Shit Registers With Output Latches) made this my chip of choice. The chip uses a third line to strobe the latch. This chip keeps the outputs the same as edata is being sent using the clock and data lines. Once all the bits are set in a buffer(of sorts) the Latch line is pulsed and the outputs are set all at once. Both shift register chips have an overflow pin that can be hooked to the data pin of another shift register. You can keep adding chips until data transfer rates are too long to be of use. Now you can control 8, 16, 24, 32…. LEDs with the two or three digital output pins. The Atari is hooked up to a device driver circuit that will provide enough power to the optocoupler IR side to produce a strong signal on the receiver side. This device driver circuit is from the Comes Alive book on page 136. The output side of the optocoupler pulses input lines on the shift register chip. The entire circuit seems to draws less power than the Atari 5V pin could provide but an external power supply for the LEDs was used in preparation of future expansion. (Motors or Memory Wire for some animation?) The eyes and head lights are on whenever the circuit is powered up. To test the circuit a simple program in BASIC was written to send one off bit and 7 on bits to the shift register. After each bit was sent the data, the latch was set making the off led move down the line of 8LEDs. Where to go from here? The possibilities seem endless. spinax control.pdf
  11. In case you missed it, there is a wire missing in the schematic. Q2(DATA) is missing a wire between the 2.2k and 33 ohm resistors and Pin8 Ground. That's it, so far.
  12. First printer was a Smith Carona or something like that. I still have a couple of memos that look so much better then inkjet. It was loud an could shake the house when the wheel was spinning.
  13. It is known that Battle Star Galactica survived because it was not hooked to the net. I'm thinking there is still hope for an 8-bit revival. Live long and prepare.
  14. What percentage of your electronics spare parts have been salvaged with the hopes of using them someday. I began to see that putting the rest of the lights on Spinax was going to be an opportunity to rummage for items to use. I wish I could remember how many years ago I walked into a casino and was given a gadget. Pull the tab and a number would be back lit. If the number as a match, you could have won $$$$. (I would have remembered the amount if I had won.) When I got it home and pried apart, I found that I had won a very nice blue LED. This was mounted in the Spinaxs head cavity by drilling a hole in the support that held the fiber optics for the eyes and pushing the LED into it. The hole was small enough to hold the LED without gluing. Two thin strains of wire was pulled off a ribbon cable. These were quite small and flexible. A length of 16 in. was soldered to each of the LED leads and will be connected to the power. I simplified the lights along the back spine by running light from LEDs to a small plastic ball to defuse the light using fiber optic filaments. It was not likely that both sides of Spinax would be seen at the same time so both sides of the spines are light using the same LED. Several methods were tried but found this to be the better option. I shopped the dollar store for some clear plastic beads to diffuse the light. A hole was drilled halfway into the bead perpendicular to the string hole. A 030 gage fiber optic strand was glued into the hole. 16 required. The 8 LED lights were salvaged from an old USB hub. The LEDs are small and I am hoping they can be powered by the Logic circuits I want to build. (If not Ill have to add a driver chip.) The tips of LEDs were filed flat and 2 fiber optics were glued on the surface. It should also be mentioned that small holes were drilled between the spikes on the back and the fiber optics was run through the holes before they were glued. Gluing the small filaments to the LEDs was not an easy task. Super glue and plastic model cement was tried. Not sure which worked better but it was a weak bond at best. Handling is breaking the bonds and have started using shrink tubing to attach the filaments to the LEDs. A small piece of shrink tubing for the led. Then a couple of pieces of wire insulation from some solid copper wire in the other end. Run the fiber optics into the wire insulation and use a piece of copper wire to clamp in place. I was able to cram all the cables along the back and under the tail. A couple of LEGO pins were added to help hold it in place. Only took a couple of tries but it fit together and will work on the interface circuit design.
  15. I haven’t found the program I’ve been searching for but I did find a disk with my favorite Atari font editor and the Diamond Font Editor. This was a mystery. I never found Diamond’s font editor to be very useful but there it was among the *.FNT, *.DFT and FONT.BAS. A *.FNT file is likely to be files containing the data for the Atari 8X8 screen font. The FONT.BAS turned out to be the Create-A-Font editor by Vince Erceg. It was copyrighted 8/2/83 and first appeared in Analog #16, February 1984. Well worth the look if you need to do any character set editing. *.DFT are Diamond Fonts. Diamond Fonts are not restricted to 8X8 characters so the first bits of the font file define the width and height of the character. FONTEDIT.APP is the Diamond Font Edit from Reeve Software, c 1989. It can be used to import *.FNT and save them to *.DFT for use in Diamond Write. When first opening the font editor the letter “A” is in the editor matrix. I was never able to move to a different letter, no matter what keys I pressed. It has taken almost 25 years for me to find the keys to move to the next or previous character. You would think someone would have mentioned that “<” and “>” will change the character to edit. (Dhaaa….) If I’d have known this sooner I would have added a couple of more starts to its rating. The editor seems to be limited to 8X8 bit fonts. The dropdown menu item File –> New Font and Option –> Font Name or Edit Char do not have any functionality. There is no way to define a different font size. If you know differently please don’t wait 25 more years to let me know.
  16. I’m assuming that everyone has hooked up an LED to their computer and made it blink. I’m also assuming that most everyone said, ”That’s cool. Now what?” I'm going to be running lights to a LEGO Bionicle and then using the Atari to control the light show. This could be accomplished with any programmable controller but, since this is an Atari Age blog, an Atari 8-bit computer seemed to be a logical choice. The Bionicle kit #8924 is the embodiment of Maxilos and his four legged friend, Spinax. The plan is to start putting the lights on Spinax and then get it connected to the computer. There is a bit of a learning curve so I’ll try to make my mistakes on Spinax. Right now the plan for Spinax is to: a. Run fiber optic cables from its eyes to a light source. b. A blue LED in its skull cavity should give an eerie glow. c. Eight small lights between the spines on its back to sequence in various patterns Spinax The eyes of Spinax are red translucent part #4497493. A 16” filament will be routed from the LED to the eye. The LEGO eye piece will defuse the light. To fulfill my obligation for free shipping, a couple of sizes of fiber optic filament was purchased. I ordered size 060 mils and 030 mils. The 060 seemed thick but gave some reasonable light transmission properties (of course I didn’t know this until after some experimentation). An insertion hole was drilled about half way into the back of the LEGO part #4497943 using a 1/16” drill for the 060 Fiber. No glue. Then one of two methods were used to attach the LED. 1. A hole was drilled partway into an LED. A fiber optic strand was then inserted into the holes to transmit the light. Super Glue was used to hold the Fiber in the LED. 2. A smaller LED had its top sanded flat and then the end of the fiber was surface glued to it. Two 1/16” holes were drilled through a support area on the underside of the skull. The fiber was run through these holes and then into the eyes. The fiber will run along the back into control box that will contain the controls. This last photo is the finished eye lights powered with 2 volts from a DC power supply. The LEDs are from a variety pack so I’m guessing they won’t blow out at this voltage. Not all the LEDs were so lucky. Now I have to clean up the bench, get the glue off my fingers and shovel the snow before I can get back to what I was doing before I started lighting my LEGO. I want to (I should) clean up at least 100 old disks before I mount my next LED. Note: Imperfections on the surface of the optical fiber will create diffusion sites. Keep cats from chewing on the fiber optics.
  17. 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)
  18. There is a big banker box about ¾ full of floppy disks for the Atari8bit sitting next to my hobby bench. They are from several systems that were purchased just before putting my 8bit equipment into storage. I’m starting on a quest to see if their content is of any interest. I was waiting to get an SIO2SD but the label glue is drying out and the labels don’t always fall into the sleeves with the disk. I guess that is part of what’s going to make this interesting. Disk #001 was an unlabeled back up copies of a recent Diamond project. After checking to be sure it wasn’t my archive copy, the disk got formatted using Atari DOS 2.5. Disk #002 – Side 1 Has DOSII Double Dens.V2 and the MMG BASIC compiler on it. Side 2 is Atari DOS 2.0s compatible with many S.A.M. programs. This disk is a keeper. I just hope I remember it the next time I find my S.A.M. Boot Disk. Disk #003 – The surprise I was looking for. Booting up with this disk took me to the “DOS XE System Function Menu”. Having never formatted a disk with DOS XE I figured this was not from my collection. At the bottom of the screen it said, “SET TO WHAT DATE?” I hesitated long enough to think that this could be my first Y2K problem, but not long enough to read how the month had to be entered. OH, well. Once I figured that sending the directory to S: made it much easier to read. It appeared that the disk was created on or around 27OC91(October 27, 1991). What was surprising was that three of the files were MIXMATCH.APP, VIEW83.APP, and DESKTOP.INF. Could this possibly be a DIAMOND disk? Rebooting with the Diamond cartridge took me back to the Set Date option. Got to the MAIN MENU and hit Exit to Cartridge. That is when the Diamond Desktop appeared. Most of the files listed in the window were DOS XE system files or Diamond files that I had seen before. At this point there were 2 files with unknown content; WELCOME.BAS and S. This appeared on the screen when I quit to BASIC and ran WELCOME.BAS. “WELCOME TO DOS XE AND ATARI BASIC THIS SAMPLE PROGRAM IS PROVIDED SO YOU CAN EXPERIMENT WITH THE ‘SETUP.COM’ PROGRAM. GOOD LUCK! READY” The file “S” was clicked and the view option selected. This file contained the disk directory, which was puzzling until I remember that when trying to get the directory in DOS XE it asked me for a destination. Once I typed “S” and when I didn’t see the directory I tried “S:”. Mystery Solved and the disk is now on top of my “ok to format” pile. There remains one last question that is unlikely to be answered. If I bought this guy’s system and he had disks for Diamond, how come I only have the Diamond cartridge I purchased direct from Reeve Soft?
  19. As if there isn’t enough hardware to hook up to your RS232 equipped computer, now you can build your own. It was a nice thought to build Arduino boards with a USB port for serial communications and programming, and even nicer that it can be equipped with an RS232 port for communicating with our Ataris. You’ll need an 850 interface or a PR:connection hooked up and running on your Atari 8-bit. The ST has an on board RS232 port. If you have hooked up a modem or set up communication to another computer using a null modem cable, you can hook up an Arduino. If you haven’t, a “can do” attitude will be a big help. There are two ways to set up a RS232 port on the Arduino. The first is to use a RS232 shield and the serial communication software that is programmed on the Arduino chip. This software is initialized when the Arduino board is powered up and uses digital pins 0 and 1 hooked up to the USB hardware. The second way is to use a software serial library that can be configured to the digital pins of your choice. The RS232 shields plug into the Arduino board and are set up to use pin 0 and 1. The shield will need to be removed to give the USB port access when down loading a program and then re-inserted to execute the code. Some have found this inconvenient and opted to modify the shield or use option 2. Option 2 is to purchase an RS232 to TTL converter board. Then wire it to the Arduino pins. You still have the option of using the built in or software serial library depending on which pins you use. You will still have to unplug it if pins 0 and 1 are used. I chose to start experimenting with the shield on the Atari 8-bit. Step 1. Program Arduino to output to serial monitor. Plug the Arduino into USB port of the computer for programming. Download the following program to the Arduino. Open up the serial monitor and look for “Hello”. Once you see that hello is being received from the Arduino through the USB port you are ready for step 2. //RS-232 Shield test//Send Hello to computervoid setup(){Serial.begin(9600);}void loop(){ Serial.println("Hello"); delay(1000);} Step 2. Read Arduino with RS232 shield with terminal program I have been using a USB to Serial converter to null modem my Net Book to the Atari. It’s a good way to add a RS232 port if one is not built in. To verify that the shield is working. Disconnect the USB cable from the Arduino. Mount in the RS232 shield onto the Arduino board. Power up the Arduino with a battery or wall wart. Plug in the shield to the RS232 port. Watch the Arduino serial monitor for the “Hello” data stream. The COM port number for the converter may be different than that of Arduino board. That’s just one of the things to check. When that works try receiving the signal with your terminal program. I use Hyper Terminal to monitor the COM port. Step 3. Connect Arduino to the Atari. A couple of changes were made to the Arduino program. The Atari can handle 9600 baud rate but at 300 baud it seemed to be easier to troubleshoot. //RS-232 Shield test//Send Hello to computervoid setup(){Serial.begin(300);}void loop(){ Serial.println("Hello Atari"); delay(1000);} Boot up the Atari with the serial port handler(R:) and terminal program. Bob Term is my program of choice. Hook up the Arduino to Port 1 and power up. Set the Baud rate to 300, Translation to ASCii, and Duplex to HALF. Or whatever you need. The biggest problem was getting the cabling right. A DB9 male to male connector didn’t work. The Atari port is not wired the same as the port on the Arduino or IBM. Adding the Null modem cable didn’t work. Mapping the pins and cable connectors would have been the good idea but trying the following worked. Atari 850 DB9 Female Atari Modem cable DB9 Male to DB25 Male Converter DB25 Male to DB9 female Serial Cable DB9 Male to DB9 Male Arduino RS232 Shield DB9 Female It brought a tear to my eye while watching the characters come through at 300 Baud and remembering it use to cost me about $65.00 per hour to be on line. (Why do I complain about my cable bill?) Now, if you’ve read this far and have your Atari talking to the Arduino, chances are you’ve thought of a hundred things to try. Somewhere out in the future, I’m hoping someone builds an 850 emulator. All you need is half a SIO cable, Arduino, and RS232 shield. Oh…….. and a bit of Arduino programing. Reference: www.cutedigi.com - find reviews of shield with some helpful hints. www.linksprite.com/wiki -> open source projects ->1.1.9 Others Shield -> RS232 Shield of Arduino. Schematics and view example code. Atari 850: Interface Module Operator’s Manual, Atari Inc., 1980 , Publication # CO15953 rev.1 Jainschigg, John, “Data Transfer: The Productivity Bridge”, Atari Explorer – Summer 1987 Monk, Simon, Programming Arduino, Getting Started with Sketches, McGraw Hill, 2012.
  20. I have a tendency to over design the circuits to keep from damaging my Atari. I'm not sure which I would hate more, destroying my computer or knowing someone else's computer got a little rarer. I'm thinking that I may sink the Christmas lights on my wife's doll house rather then going outside in the cold.
  21. Seems not so long ago if you wanted to control a relay switch through your Atari 8bit joystick port, you had to build the hardware from scratch. Not anymore. Now you can buy circuit boards with 1, 2, 4, 8, or 16 relays. A couple more parts and you've got what it takes to control your world. Search Amazon with the key words Arduino Relay for an idea of what is readily available. I ended up with a SainSmart 4 channel relay board not because it was the best but because I wanted to get one before I grew old doing the research. Most likely any of the boards that work with the Arduino will work with this setup. The joystick ports 5 volt pin might be able to power all four relays at the same time but you will be very close to drawing the maximum amperage with a 4 channel board. An external 5 volt power supply for the relays would eliminate the potential of exceeding recommended power draw. (Actually I used 3 1.5V C batteries.) For another level of safety an optocoupler was used at the joystick pins to isolate the computer and external power supply. I did have a bit of a problem when the power from the computer was not enough to fully turn on the output. The isocoupler output still had about a 3V drop across the leads, not enough power was avalible to activate the optocoupler on the board. When a 2n2222 transistor was added to do the switching, it worked. The drawing shows the circuit for one channel. Replicate this circuit for each channel you want to control. The relay contacts were connected to turn on and off an LED. A 1.5V battery and LEDs were used for test purposes. This simple test program randomly turns on and off the relay contacts. Im going to have to read the description for these locations in Mapping the Atari a couple more times to understand why it works. 5 REM RELAY TEST PROGRAM 10 POKE 54018,48 20 POKE 54016,255 30 POKE 54018,53 40 POKE 54016,0 50 POKE 54016,INT(RND(0)*16) 60 FOR X=1 TO 200:NEXT X 70 GOTO 50 Now I just need a program that will play AMS Christmas music songs and set the output pins. Then Ill be ready to Griswold the house. And what a wonderful present it would be if you send me a copy of your program.
  22. You may want to consider using an optoisolator or optocoupler between the Arduino board and Joystick port digital input pins 1 to4. Connect the photo transistor side to joystidck pins and ground to act as the switch. Connect input side of the optocoupler to the arduino as you would a LED. Control the Arduino pin with digitalWrite(LEDpin, HIGH/LOW). The optocoupler provides some level of safety since there is no physical contact between the computer and arduino. Check out the blog, "Out of the Pack". There is a couple of examples of this method.
  23. Radio controlled mini cars don’t last forever. Sometimes they get stepped on and sometimes the battery won’t charge anymore. In any case, when the radio transmitter and receiver still work, it may be an opportunity to hack a 4 output digital controller. The receiver unit is from a Bensu Mini Racer. They all seem to have slightly different electronics under the hood but most serve the same functions; forward, reverse, right and left. IR control systems for these cars may pose unknown problems that you will need to address. An h-bridge type circuit is used to control the voltage to the motor. The motor is replaced by 2 LEDs in reverse polarities. When Forward button is pressed one LED lights. When the reverse button is pressed the voltage polarity switches and the other LED lights. The steering is accomplished with 2 electro magnets. Energize one magnet and it pulls the steering mechanism for a left turn, the other to the right. Replace the coils with LEDs. Polarity matters. (This receiver switched the ground connection. Not sure if they are the same for all) The battery in the Bensu car was 1.2 volts. This was barely enough to light the LEDs and needed a higher voltage. A 1.5 Volt battery was used to power the receiver without producing any smoke. Higher voltage may be require the addition of resistors in line with the LEDs to limit current flow. With the LEDs and battery hooked up, the receiver can be tested. Power up the transmitter. One LED should light up for each of the buttons on the transmitter. Press 2 buttons and unexpected combinations will appear. Such is life. The LEDs were for test purposes. Replace all the LEDs with the LED side of an optocoupler (see previous blogs). Hook the photo transistors to the joystick port pin 1 to 4, and ground. You should be able to play a game that requires you to move in 4 directions and not use a trigger button. PacMan comes to mind. This may have limited use on a game machine. Being able to wirelessly trigger events from a remote position may be what you need for that computer project. Radio waves will go through solid objects so your remoteness may only be limited by the transmitter power. Plus, you also have that feeling of pride that only comes from keeping one more piece of electronics out of the landfill. NOTE: This receiver has been used with a Mindstorms/HiTech prototype board and an Arduino Uno. Slight modifications to the circuits were required for each. NOTE: Optocouplers are my friend.
  24. Since I was successful getting the Wii Nunchuk hooked up to the Joystick port I thought I would try the Wii Classic Controller (WCC). The hardware was simple, unplug the nunchuk attached to the Arduino project from my last blog and plug in the WCC. It was my poor choice of internet search criterial that gave me the most trouble. I just needed to find the function library for the WCC. The first search pointed me to “playground.arduino.cc/Main/WiiClassicController”. This is a library created by Tim Hizel in May of 2008. The library and example program worked as stated but only reported the buttons once or twice and then reset, even if the button was still pressed. I needed to be able to read the logic state while the button was pressed. Sooooo, it was back to the search engine. After a couple of days of half-hearted searching I decided that I would need to figure out why the button state reset and write my own library. But that night there was a Christmas Miracle. I found myself wide awake at 4:00AM. Mostly due to the excitement from the anticipation of Santa’s arrival. After all, only 14 days till Christmas. Anyway, I decided not to fight it and sat on the couch searching for the elusive library. I clicked on a search link and in a flash I was at “playground.arduino.cc/Main/WiiClassicController10” (see the difference?). This library is an exact replacement for Tim’s; written by Robbert Brandsman in 2012. It keeps the state of the buttons while they are pressed. Just what I needed. Now load the following sketch. Change the #include to point to the WiiClassicController10 library you downloaded. Upload it to the Arduino and you are ready to play any game that requires the joystick. The sketch uses the DPad for the direction control and the X or Y button for the trigger. I suppose if you got this far, you can modify the program to reflect your preferences. Atari_Wii_Classic.ino void setup(){ wiiClassy.begin(); wiiClassy.update(); pinMode(Up_Pin,OUTPUT); pinMode(Down_Pin,OUTPUT); pinMode(Left_Pin,OUTPUT); pinMode(Right_Pin,OUTPUT); pinMode(Trig_Pin,OUTPUT);}void loop() { delay(10); // 1ms is enough to not overload the wii Classic, 100ms seems to ease the serial terminal a little wiiClassy.update(); if (wiiClassy.upDPressed()) {digitalWrite(Up_Pin,HIGH); } else {digitalWrite(Up_Pin,LOW);} if (wiiClassy.downDPressed()) {digitalWrite(Down_Pin,HIGH); } else {digitalWrite(Down_Pin,LOW); } if (wiiClassy.leftDPressed()) {digitalWrite(Left_Pin,HIGH); } else {digitalWrite(Left_Pin,LOW); } if (wiiClassy.rightDPressed()) {digitalWrite(Right_Pin,HIGH); } else {digitalWrite(Right_Pin,LOW); } if(wiiClassy.xPressed() || wiiClassy.yPressed()) { digitalWrite(Trig_Pin,HIGH); } else {digitalWrite(Trig_Pin,LOW); } } I’ve been using the Atari Joystick for so long that while playing Missile Command with the WCC I noticed my left thumb was taping the DPad, as if it was a big red button. A reboot ain’t guna correct that problem.
  25. That may have some interesting possibilities. I'm wondering if my score would improve by using a pulsed signal for the steering while playing Pole Position. I'm still trying to build a knowledge base on the Arduino and have lots of things to try. Never sure what I'll try next. This ones on my bucket list.
×
×
  • Create New...