Jump to content
mytek

Joystick Hardware Emulation on the TK-II

Recommended Posts

First let me start off by saying this will eventually cover 3 distinct upgrades, with the first one being what is called the ARROW2JOY-XLD. As the name implies this is meant for use with a 1088XLD. So what's this all about? Well first let me tell you a small story (I promise I'll keep it short and sweet).

 

I was looking at the various Atari 8-bit emulators the other day, and noticed that one in-particular supported a joystick mode via the arrow keys on the keyboard. My first reaction was "Hey that's Cool!", and so it began.

 

Now how could I do something like that with the TK-II hardware? Well it turns out I first had to steal a page from the AKI (Atari Keyboard Interface). The AKI syncs up with the Pokey chip on the Atari using only 2 bits of Pokey's 6-bit key scan counter and then builds a copy in software running inside the PIC chip that drives it. In retrospect my design was using all 6-bits of the Pokey counter as a reference. So in order for me to free up some I/O for other uses (i.e., Joystick mode), I decided to mimic what the AKI was doing. This freed up four I/O lines which I was able to decode into 9 states. That being JOY-Up, JOY-Down, JOY-Left, JOY-Right, Aux1, Aux2, Aux3, standby (IDLE), and finally JOY-Trigger. The trigger function had to be kept separate, so that it could be initiated independently of direction. Since I was addressing a 74LS156 decoder with 3 of the I/O lines, that gave me 8 possible decoded outputs, with one as I already mentioned being a 'do nothing' state. So as part of the decode process I automatically got 3 extra outputs beyond the 4 direction bits I required, which I called AUX 1-3. I decided to terminate these 3 outputs on an independent 3-pin header. They are open collector and momentary in nature, so would work fine for something like a disk swap button, something the XLD already has implemented for its built-in IDE. Anyway they were free, and are available for whatever the user wants.

 

Getting back to the Joystick aspect, here is how that's been applied in a new version of the TK-II firmware (V2.5J).

 

Basic Keyboard Commands

  • PS/2 ALT+J toggles into and out of the Joystick Mode*
  • PS/2 Arrow Keys produce Joystick X/Y direction switching
  • PS/2 Left-Windows Key = Joystick Trigger Button
  • PS/2 ALT+1-3 = AUX outputs 1-3

 

*Note: The Joystick Mode is volatile, and will go back to the arrows navigation mode (default) on a power cycle.

 

So here's what the new TK-II piggyback upgrade board looks like (plugs right into the TK-II chip socket on the 1088XLD motherboard).

A2J_PCB_top.thumb.jpg.d61b54d90eac840cfde10ef908b1f327.jpg

A2J_PCB_bot.thumb.jpg.512a06b78613ec305f491d314d5f1d25.jpg

And it has a small companion interface board to connect up with the joystick signals on the 1088XLD.

 

ARROW2JOY-XLD_complete.thumb.jpg.9a9a5ac9fb2cc6671a738ca95ea7a0d1.jpg

 

Here's the complete system in use.

 
 
 
There were other changes in the 2.5J TK-II firmware which will need to be documented, and there is a new version coming of the TK-II Pokey piggyback board for use in standard Atari systems that will integrate the joystick functions. So stay tuned for more info to come :) .
 
 
  • Like 6

Share this post


Link to post
Share on other sites

This is the next upgrade on the horizon, and is designed to drop into anything from a 400/800 to an XL/XE.

 

TK-II-PBJ: TransKey - 2nd Generation - Pokey PiggyBack - with Joystick Functionality

 

Board Top View

TKII-PBJ_top.thumb.png.a665ab61e1e854bdfa09a905c91363cc.png

 

Board Bottom View

TKII-PBJ_bot.thumb.png.797f4bc202d25b1ecbe17b3b6fb31c49.png

 

Schematic: TK-II-PBJ_schema.pdf

 

This one board will most likely take the place of the two existing Pokey piggyback boards on my TK-II page (shown below).

 

Standard Orientation

TK-II-PB_top.JPG

Reverse Orientation

tk-ii-pb_reverse_assy_top.jpg

 

  • Like 6

Share this post


Link to post
Share on other sites

Besides the Arrows to Joystick aspect, the new 2.5J TK-II firmware now provides for two different F-Key mapping schemes for HELP, Start, Select, Option, Reset.

 

Standard TK-II F-Key mapping

1657297394_TK-IISTDFkeyMap.thumb.png.907ca95e0474d60007700db612e57268.png

 

DarkAKI F-Key mapping

1272504043_DarkAKIV2_5JFkeyMap.thumb.png.e96dd2ec4ef6c4870db10aec8cad6441.png

 

CTRL+ALT+E will toggle between the two F-Key Emulation schemes. This is a non-volatile selection and will be restored after each power cycle.

 

ALT+E will show you what the present setting is without disturbing it.

 

The DarkAKI setting mimics some of the F-Key assignments of the AKI keyboard adapter that Lotharek produces, and thus is a more Altirra-like layout concerning the console and reset keys. If you tend to use that emulator, or you plan on mixing TK-II's with AKI's this will make you feel right at home.

 

So if you are interested in having this aspect, irrelevant of whether you have the Arrow to Joystick hardware, download and flash the new V2.5J firmware to your TK-II PIC chip. the firmware is available at: https://ataribits.weebly.com/arrow2joy-xld.html

However please keep in mind that certain features were removed to make space for these new ones. The removed features are listed next to the download link.

 

  • Like 3

Share this post


Link to post
Share on other sites

I've decided to do a very minor update of the 2.5J firmware for the TK-II. Basically I'm adding one more Trigger Button hot key. It kind of bugged me that my IBM Model M keyboard didn't have any Windows keys, so that would have excluded it from being able to fully use the Joystick emulation mode due to missing a trigger button. So I decided to also make the #5 key on the Numpad a trigger button as well. With people that do have a keyboard with a Left-Win key, this will now give them the choice of either a left or a right trigger button.

 

I'll be updating the PIC flashing file in a few minutes. The firmware version number will remain unchanged, but the date that shows up when pressing ALT+F1 will be today's date 1-17-2020.

 

TK-II Firmware V2.5J PS/2 Keyboard Map

 

1616571202_TK-IIKeyboardMapv2_5J.thumb.png.939189ea400acc2c1ce4a946b1b385b7.png

 

 

EDIT1: Updated Firmware now available at: https://ataribits.weebly.com/arrow2joy-xld.html

EDIT2: Ok so I changed my mind after using it. Instead of Numpad #5 being the 2nd trigger Button, I chose the Numpad Enter key instead. It just felt like it was in a better position, and more comfortable to use.

EDIT3: Changes have now been incorporated into the manual.

 

  • Like 2

Share this post


Link to post
Share on other sites

Unfortunately something isn't quite right with the latest 2.5J TK-II firmware. I'll have to investigate, and see where I F__ked up :? .

 

First I need to figure out a consistent way to make it break, and then I'll have a test for when it's fixed.

 

Edit: I think I figured out what was happening. If it checks out over several days tests, then I'll put the download back on my site.

 

  • Like 2

Share this post


Link to post
Share on other sites

New TK-II-PBJ boards have arrived from China.

 

20200202_085510.thumb.jpg.484e5d4de42e5645d1266d996fffada9.jpg

 

446330073_JLCpcbTK-II-PBJOrder.thumb.png.4c2a98d4fdc8b0e1b1c022fe58bc1a59.png

 

I did these via slow post leading up to the Chinese New Year, and wasn't expecting them for another week. They came so fast, that they beat out my Digi-Key parts order, which has the SOIC version of the PIC16F1847 that I'll need. At only $1 per board, you can't beat the pricing that I get from JLCpcb. They also offer DHL shipping with a 'production to your door' turn-around of no more than 5 days, but that can get a bit costly.

 

 

  • Like 4

Share this post


Link to post
Share on other sites

Unfortunately I made a mistake on the CNC drill file that went out with the gerbers for the TK-II-PBJ boards that I just received. Due to the limitations of my PCB layout software, I wasn't able to spec a .056" diameter drill for the machine pin holes in the source file. This is normally not a problem, since I can just edit the file with something like notepad, and change the dummy hole size (.052) to .056 on the tool call-out line (see example below).

FMAT,2
INCH
T01C.014
T02C.029
T03C.035
T04C.056 <---- changed from .052 to .056

So after I made this small change I sent the file off to have another set of boards made.

 

JLCPCB_TK-II-PBJ.thumb.png.4920a59071bd4c888b05a64c1cc3ba13.png

 

And while I was at it, I also made some modifications to an existing PS/2 connector interface board, making it more specific to this application.

 

JLCPCB_PS2-INTFC.thumb.png.4aeec6469a2696cd7cb35cbaf1c35d8f.png

 

 

The original PS/2 connector board made for the previous TK-II-PB series boards, will still work if only one half of the DIL header is used. So if you have one of those mounted in your A8, it can still be used if you decide to update from the TK-II-PB to this new TK-II-PBJ. I still plan to keep all the original boards available for that series since they can be used for dual PS/2 keyboard connection with firmware prior to V2.5J.

 

When I sent off the order at the JLCpcb site I saw this new notice on the top of the website...

Latest Announcements!

Due to coronavirus outbreak, production of Multi-layer PCBs, SMT assembly and stencils was postponed to February 10.
DHL announced that their service will temporarily be suspended till February 6. 

Please view the notice for lastest information and thank you for your understanding and support during this time. 

This gave me some concern, so I decided to check for transmission of the virus through inanimate objects being shipped, and apparently that is very unlikely due to the virus not being able to survive for long outside of a host body. I'm pretty sure that the delay as noted in the announcement, is to allow those production and shipping portals to put into place safety procedures to better protect their own personal.

 

  • Like 2

Share this post


Link to post
Share on other sites

There were some mistakes on the ARROW2JOY Bill of Materials shown on my website. I discovered this when making a test order utilizing the embedded part number links. Below is the corrected BOM for items 4 and 5.

 

This is only a photo capture from the ARROW2JOY page, so these links will not be functional.

 

BOM.png.3bed7651478bd549be72a4532ef096c8.png

 

For the time being I chose alternative vendors for these corrected items, since I have direct experience ordering these particular items from them and I know that they will work. Later if I find suitable Digi-Key alternatives I'll update the BOM based on that.

 

If someone has already ordered from the previous BOM, please send me a PM and your address, and I'll be sure you get the right parts to complete your assembly.

 

  • Like 1

Share this post


Link to post
Share on other sites

TK-II-PBJ Assembled, Flashed, and Tested

 

After an additional 2 weeks of waiting due to the Corona Virus, the corrected boards finally arrived for the newest TK-II iteration from JLCPCB in China.

 

Assembly Step 1: mount SMD and inner socket components (without the socket in the way, its easy to fix solder bridges with solder wick)

TK-II-PBJ_top_assy.thumb.jpg.4ce3be981d57285c195238217e031b85.jpg

 

Assembly Step 2: after removing the socket's inner cross supports, it's time to mount the Pokey IC socket and a 40-pin connection header

TK-II-PBJ_top_assy_complete.thumb.jpg.6dfbb5367882bc97cf1437d9f883aa8c.jpg

 

Let's flip it over and see what it looks like  underneath

TK-II-PBJ_bottom.thumb.JPG.c33f6402619ad6d96ebe011a8e01aa0c.JPG

 

Time to Flash the Firmware

Connecting to JOY2PIC for In Circuit Serial Programming of the PIC

Flash_PIC.thumb.JPG.e040308a92ea346340eaaeee710324c6.JPG

 

Using SIO2PC, load the V2.5 Flashing ATR and you should see this screen on your Atari

Flash_PIC1.jpg.1bb7f33a204cf5aaf09d08ef63a0a77a.jpg

 

Begin flashing process

1714527545_press_START.thumb.JPG.f8986fd9f83424475b809d78691d529f.JPG

 

Done!

Flash_PIC2.jpg.56eb47f41ecc3a0c37480f3a6c0836d4.jpg

 

Assemble PS/2 connector interface board

TK-II-PBJ_INTFC_front.thumb.JPG.1201d36e6a0cfd356098500dc9e6d3f9.JPG

 

TK-II-PBJ_INTFC_back.thumb.JPG.f8e4c7da5ea09332b6aa372dd8672b06.JPG

 

Installation into 1200XL (not that it needs it ;-) )

Mount PS/2 connector interface board in place of removed RF modulator (ream out the RF jack hole)

TK-II-PBJ_INFC_mounted.thumb.JPG.e5dd516b161c45cb806ed694592a5636.JPG

 

install Pokey piggyback board into Pokey's socket and connect cables (lots of cable work required)

TK-II-PBJ_installed3.thumb.JPG.ae363d44d5f830e162a31b5009a387a9.JPG

 

The Joystick connections are optional, but required if you want to use the NEW Arrow-to-Joystick mode.

 

TK-II-PBJ_installed1.thumb.JPG.429c32f04c5e0992377139d4c91add55.JPG

 

TK-II-PBJ_installed2.thumb.JPG.a2d04ff90c9b88f4adec4d969b4388ed.JPG

 

It works 👍 :)

working.thumb.JPG.aace8aebc3d4292e73405008377a83c6.JPG

 

A size comparison to Lotharek's similar product the AKI PS/2 Keyboard Interface

 

TK-II-PBJ_vs_Lotharek_AKI.thumb.jpg.7661624a354635a53d16aaad2e838cb2.jpg

 

Board fabrication and schematic downloads now available at: https://ataribits.weebly.com/tk-ii.html

 

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Does it works with TKII-stereo if I will patch a PIC with the new soft?

 

thx.

Edited by piomet

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...