Author Topic: TI83+ series compatible GAMEPAD!!!  (Read 5161 times)

0 Members and 1 Guest are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
TI83+ series compatible GAMEPAD!!!
« on: July 11, 2012, 05:33:30 pm »


How it works:
There is a small microcontroller inside which converts signals sent from the calculator into control signals for a data selector (multiplexer). This selects which button to read. The output of this is fed back into the calculator. The calculator needs to run some code to be able to read the keystrokes. This code is easy to implement into existing games (hint hint)

How it works for technicians:
The calculator runs code to pull down the one line of the I/O port (1->port) then the AtTiny45 MCU @1MHz inside the gamepad increases the value of a counter. The binairy value is then used to control a multiplexer via a 3 bits wide control bus. All of the buttons are hooked up to the multiplexer. The output of the multiplexer is fed back into the calculator's I/O port. After a short delay the calculator reads the port value. This corresponds with a keypress or not.

At the moment there are some mechanical issues with the gamepad (bad contacts and bad solder connections). Also: it is very time consuming to fit everything inside the gamepad. I had to mod the plastic casing a bit to make everything fit. I might wanna make converter boxes of some sort instead.


This project was requested by stevon8er. Are there more omnimaga members interested in this product? If there is a larger user base it would be more feasable for software developers to make their programs compatible with their games (it is really easy to do so!)


Code to read keystrokes:
Code: [Select]
Lbl RKEYS
For(r1,0,7
1->port
Pause 1
If port=0
1->{GDB1+r1}
Else
0->{GDB1+r1}
End
2->port
Pause 2
End
After a delay of PAUSE 16 the microcontroller times out and resets the counter.


What do you think??
If you like my work: why not give me an internet?








Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: TI83+ series compatible GAMEPAD!!!
« Reply #1 on: July 11, 2012, 06:40:46 pm »
I think the game pad is undeniably cool, however I don't think it is all that practical. Also, wouldn't reading the keypresses from the serial port be a bit slow for use in actual games?

I'd also mention if you haven't posted your hardware stuff at cemetech you really should. They do a lot more hardware related stuff there, and Kerm (who runs the place) is a bit of a hardware junkie himself. ;)

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: TI83+ series compatible GAMEPAD!!!
« Reply #2 on: July 11, 2012, 07:07:20 pm »
That's pretty cool :D

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: TI83+ series compatible GAMEPAD!!!
« Reply #3 on: July 11, 2012, 07:11:37 pm »
I always thought of that. It would be possible on the TI-89 as well, right?
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: TI83+ series compatible GAMEPAD!!!
« Reply #4 on: July 11, 2012, 07:26:48 pm »
Reading keypresses is as fast as the code example. You can also just leave out the action buttons and just check for the directional keypresses as they are mapped first on the multiplexer. After a PAUSE 16 the counter resets to zero, but you can just send in a few more clockpulses from the I/O port to reset it. It's not that slow at as you can use the stored keypresses multiple times instead of checking for keys all the time. It's a tiny sacrifice for GAMEPAD COMPATIBILITY o________O

If you want max speed you'd have to mod your calculator and put a connector on it which is hardwired into the keypad. My goal was to create a device for non-hardware junkies to interface with their calculators. It's part of the TI-Nterface project. It started with the interface platform. Now I'm building all sorts of peripherals for TI calculators :)

I have posted some hardware stuff a few months ago @cemetech. I'm gonna post some of my latest creations there.
If you like my work: why not give me an internet?








Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: TI83+ series compatible GAMEPAD!!!
« Reply #5 on: July 14, 2012, 07:30:42 pm »
Nice.
Have you thought of directly sending key commands to the TI serial format ?

That format is supported on all flash z80/68k calculators except the TI-73.

It's used by the TI-Keyboard device and by the TilEm software when it sends the ROM dumping command to the calculator for example.


That way, games might not have to adapt themselves to your controller.
« Last Edit: July 14, 2012, 07:31:19 pm by critor »
TI-Planet co-admin.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: TI83+ series compatible GAMEPAD!!!
« Reply #6 on: July 15, 2012, 04:31:39 am »
Nice.
Have you thought of directly sending key commands to the TI serial format ?

That format is supported on all flash z80/68k calculators except the TI-73.

It's used by the TI-Keyboard device and by the TilEm software when it sends the ROM dumping command to the calculator for example.


That way, games might not have to adapt themselves to your controller.
Does that work while ASM games run? Otherwise it's not feasable.
If you like my work: why not give me an internet?








Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: TI83+ series compatible GAMEPAD!!!
« Reply #7 on: July 15, 2012, 06:10:27 am »
I'm not sure, but I'm just trying to help you finding a way which does not require every game author to update their games.
TI-Planet co-admin.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: TI83+ series compatible GAMEPAD!!!
« Reply #8 on: July 15, 2012, 12:32:47 pm »
The I/O port is driven by software, so you need to either mod a game yourself (ask for the source) or hard wire every button on the gamepad into your calculator :P

Edit: I am now writing a benchmark program to compare the speed of the gamepad vs the buttons on the calculator.
« Last Edit: July 16, 2012, 12:40:36 pm by Keoni29 »
If you like my work: why not give me an internet?