pfeuh Posted June 25, 2020 Share Posted June 25, 2020 Hello, As far as I remember, on an Atari 800XL, there are 2 joystick's directions on 1 parallel 8 bits port, which can be input or output. The idea is to send in parallel 7 bits ascii characters and use the 8th bit as a latch signal, using the 2 joystick's SUBD9 connectors... Is there somewhere a documentation to easily program this? Perhaps with some POKES? Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 25, 2020 Share Posted June 25, 2020 The PIA docs can help. Set PACTL so that the data direction register becomes visible on PORTA (the same location also does the IO) Set PORTA bits to reflect which pins will be input or output (1 = output) Set PACTL so that the port operates in normal mode (DDR off) Do your read/write stuff to PORTA. For Basic it won't make much difference but in assembly programs stuff like screen DMA and the normal VBlank interrupt will cause jitter if you attempt high speed IO. Your idea of using a strobe bit sounds OK. Also refer to a recent thread about PIA. For really high speed stuff, the 1 to 0 transitions are near instant but 0 to 1 will usually have jitter. For your type of IO - if bit 7 is your strobe use value 0 to indicate new data. Put new data on with the high bit set, then again with high bit clear. Of course if using Basic that stuff won't matter much. At the other end just ensure several microsecond delay from when the new data is flagged to reading it. You also have stick buttons (STRIG) which are input only but could be used for signalling from the other end. Quote Link to comment Share on other sites More sharing options...
StickJock Posted June 25, 2020 Share Posted June 25, 2020 (edited) You will want to work with PORTA ($D300) and PACTL ($D302). Here's what Mapping the Atari says: Edit: sorry about the formatting - I just cut & pasted from Mapping. Here's the URL for it: https://www.atariarchives.org/mapping/ 54016 D300 PORTA (W/R) Reads or writes data from controller jacks one and two if BIT 2 of PACTL (location 54018) is one. Writes to direction control if BIT 2 of PACTL is zero. These two port registers also control the direction of data flow to the port, if the controller register (54018, below) is POKEd with 48 ($30). Then, if the bits in the register read zero, it is in input (R) mode; if they read one, it is in output (W) mode. A zero POKEd here makes all bits input, a 255 ($FF) makes all bits output. BITs 0 to 3 address pins one to four on jack one, BITs 4 to 7 address pins one to four on jack two. POKE 54018 with 52 to make this location into a data register again. Shadow registers are: STICK0 (632; $278, jack one), STICK1 (633; $279, jack two) and PTRIG0-3 (636-639; $27C-$27F). Bits used as data register 7 6 5 4 3 2 1 0 --Jack 0-- --Jack 1-- --Stick 1-- --Stick 0-- Forward = BIT 0, 4 = 1 Backward = BIT 1, 5 = 1 Left = BIT 2,6 = 1 Right = BIT 3,7 = 1 Neutral = All four jack bits = 1 PORTA is also used to test if the paddle 0-3 triggers (PTRIG) have been pressed, using these bits: Bit 7 6 5 4 3 2 1 0 PTRIG 3 2 - - 1 0 - - Where zero in the appropriate bit equals trigger pressed, one equals trigger not pressed. The PORT registers are also used in the keyboard controller (used with a keypad) operation where: Bit 7 6 5 4 3 2 1 0 Row 4 3 2 Top 4 3 2 Top Jack ..........2.......... ..........1........... Columns for the keyboard operation are read through the POT (PADDL) and TRIG registers. See Micro, May 1982, and the Hardware Manual for more information on jacks and ports. 54018 D302 PACTL (W/R) Port A controller (see 54016 above). POKE with 60 ($3C) to turn the cassette motor off, POKE with 52 to turn it on. You can put a music cassette in your program recorder, press PLAY and then POKE 54018,52. Your music will play through the TV speaker or external amplifier while you work at the Atari. You can use this technique to add voice tracks to your programs. To turn off the music or voice, type POKE 54018,60. PACTL can be used for other external applications by the user. Bit use is as follows: Bit Function 7 (read only) Peripheral A interrupt (IRQ) status bit. Set by Peripheral (PORT) A. Reset by reading PORTA (53774; $D20E). 6 Set to zero. 5 Set to one. 4 Set to one. 3 (write) Peripheral motor control line (turn the cassette on or off; zero equals on). 2 (write) Controls PORTA addressing. One equals PORTA register; zero equals direction control register. 1 Set to zero. 0 (write) Peripheral A interrupt (IRQ) enable. One equals enable. Set by the OS but available to the user; reset on powerup. Edited June 25, 2020 by StickJock Sorry for format, added mapping url Quote Link to comment Share on other sites More sharing options...
pfeuh Posted June 25, 2020 Author Share Posted June 25, 2020 Awesome! Thanks a lot, guys, you make my day! As a receiver, I will use an Arduino with XL's strobe connected to an interrupt pin on falling edge. Even in language machine on the XL, there will be no timing problem. After this step, a big buffer and a serial transmission on an UART. I'll be back if the project will continue. Regards, Pfeuh Quote Link to comment Share on other sites More sharing options...
pfeuh Posted July 2, 2020 Author Share Posted July 2, 2020 (edited) Hello, There is perhaps a cheaper solution than returning 8 bits of a joysticks port. Once upon a time, there was a famous French device called Minitel, all l the worlds laughed at us, anyway I assume. This particular terminal worked at 50 bauds in emission and 2400 in reception. The idea for sending bytes (in this case it's 8 bits instead of 7) is to send serial characters in one returned joystick port bit. The 50 bauds is very precise and easy to get, it is the VBI frequency on secam machines... And also the counted value on addresses 18, 19 and 20, if my memory still lives. I think that cheaper is not possible, do you think it is a good idea? Edited July 2, 2020 by pfeuh shell Quote Link to comment Share on other sites More sharing options...
+David_P Posted July 3, 2020 Share Posted July 3, 2020 The Supra 300AT modem did just that, through the joystick port. Quote Link to comment Share on other sites More sharing options...
pfeuh Posted July 3, 2020 Author Share Posted July 3, 2020 Finally, it's not a so bad idea! Does it mean that this modem works at 50 bauds? Quote Link to comment Share on other sites More sharing options...
+David_P Posted July 4, 2020 Share Posted July 4, 2020 Runs at 300 baud, and can be tweaked up to 450? as I recall. It's been over 30 years since I've connected at 300 baud, so some details are a bit fuzzy. Before they were Supra, they were MPP, and sold the same modem as the MPP-1000C. A little work with Google should provide additional information, including drivers. Quote Link to comment Share on other sites More sharing options...
Jeffrey Worley Posted July 4, 2020 Share Posted July 4, 2020 (edited) 50 minutes ago, David_P said: Runs at 300 baud, and can be tweaked up to 450? as I recall. It's been over 30 years since I've connected at 300 baud, so some details are a bit fuzzy. Before they were Supra, they were MPP, and sold the same modem as the MPP-1000C. A little work with Google should provide additional information, including drivers. That's right. The MPP1000c and 1000e were both connected to joystick port #2 and were software configurable from 1 to 600 baud (you could set it higher but it would just spew garbage). At 600 baud it pretty much made junk, but at 450 on a clean line it worked well. Some BBS of the days had a menu option to change baud rate to 450, for other MPP1000x users. We were in a little high-speed club. It was cool. Also, the Atari 1030 modem was known for running a little slow (IIRC 293 baud?), so this feature was also useful for dialing it the proper baudrate for good comms with the two modems. Edited July 4, 2020 by Jeffrey Worley Quote Link to comment Share on other sites More sharing options...
+David_P Posted July 4, 2020 Share Posted July 4, 2020 I have vague recollections of someone claiming to run a two-line BBS on a single 800xl with MPP modems on both ports, but it's 30+ years, so I may be misremembering. ANTIC Review: https://www.atarimagazines.com/v3n3/productreviews.html Earlier AtariAge discussion: And the Smart Term source code, courtesy of Kevin Savetz' hard work: Quote Link to comment Share on other sites More sharing options...
pfeuh Posted July 4, 2020 Author Share Posted July 4, 2020 Thanks for that source code. I have another way to explore, much faster, it's about using the horizontal blank interrupt. There is an io port which freeze the CPU until the spot is going back to draw next line, used usually to draw rainbows (and also used in DE RE ATARI to produce an audio sinus). It's possible to write a bit, block the CPU, write a bit... The time between each end of blocking is extremely precise, I don't remember all figures but using 10 bits per bytes, having something like 300 lines, it's possible to send 30 bytes per video frame, that means 1500 bytes per second on a SECAM system with 50 frames per second... Not so bad for a do-it-yourself. Quote Link to comment Share on other sites More sharing options...
phaeron Posted July 6, 2020 Share Posted July 6, 2020 On 7/4/2020 at 10:36 AM, pfeuh said: I have another way to explore, much faster, it's about using the horizontal blank interrupt. There is an io port which freeze the CPU until the spot is going back to draw next line, used usually to draw rainbows (and also used in DE RE ATARI to produce an audio sinus). It's possible to write a bit, block the CPU, write a bit... The time between each end of blocking is extremely precise, I don't remember all figures but using 10 bits per bytes, having something like 300 lines, it's possible to send 30 bytes per video frame, that means 1500 bytes per second on a SECAM system with 50 frames per second... Not so bad for a do-it-yourself. This is how the XEP-80 works. One thing to keep in mind is that using WSYNC only works for sending from the computer to the device. When receiving from the device, you have to sync to the start bit and WSYNC alone may give bad timing (too close to between bits). The second is that there is a limit to the baud rate you can push through the joystick ports due to the protection circuitry. 15.7KHz with WSYNC is fine, higher you may have problems. I have pushed the joystick port and XEP-80 to 31.5Kbaud (2 bits/WSYNC) but it requires timing compensation to ensure that 1 bits are received reliably on a variety of computers. You can get higher bandwidth if using multiple joystick lines for a parallel protocol instead of serial. Quote Link to comment Share on other sites More sharing options...
pfeuh Posted July 6, 2020 Author Share Posted July 6, 2020 (edited) Thanks for this information. I wasn't aware that this already exists. On 7/6/2020 at 3:10 AM, phaeron said: 15.7KHz with WSYNC is fine, higher you may have problems. It's enough for my purpose, sending keyboard hits in real time. Edited July 12, 2020 by pfeuh shell Quote Link to comment Share on other sites More sharing options...
Jeffrey Worley Posted July 6, 2020 Share Posted July 6, 2020 On 7/4/2020 at 9:47 AM, David_P said: Runs at 300 baud, and can be tweaked up to 450? as I recall. It's been over 30 years since I've connected at 300 baud, so some details are a bit fuzzy. Before they were Supra, they were MPP, and sold the same modem as the MPP-1000C. A little work with Google should provide additional information, including drivers. That's right. The MPP1000c and 1000e were both connected to joystick port #2 and were software configurable from 1 to 600 baud (you could set it higher but it would just spew garbage). At 600 baud it pretty much made junk, but at 450 on a clean line it worked well. Some BBS of the days had a menu option to change baud rate to 450, for other MPP1000x users. We were in a little high-speed club. It was cool. Also, the Atari 1030 modem was known for running a little slow (293 baud comes to mind), so this feature was also useful for dialing it the proper baudrate for good comms with the two modems. It came in pretty handy. best, Jeff Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.