CEMETECH
Leading The Way To The Future
Login [Register]
Username:
Password:
Autologin:

Don't have an account? Register now to chat, post, use our tools, and much more.
Latest Headlines
Online Users
There are 133 users online: 10 members, 91 guests and 32 bots.
Members: ACagliano, Ashbad, Deep Thought, flyingfisch, HOMER-16, Spyro543, Tari.
Bots: VoilaBot (2), Spinn3r (1), MSN/Bing (1), Magpie Crawler (4), VoilaBot (4), Googlebot (19), MSN/Bing (1).
RSS & Social Media
SAX
You must log in to view the SAX chat widget
Author Message
keoni29


Advanced Newbie


Joined: 18 Feb 2012
Posts: 41

Posted: 12 Jul 2012 02:33:10 am    Post subject: TI83+ Series Compatible Gamepad


Link


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)

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 want to make converter boxes/adapters instead.


Code to read keystrokes:

Code:
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. In further revisions this delay can be decreased if necessary.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55760
Location: Earth, Sol, Milky Way

Posted: 12 Jul 2012 12:02:08 pm    Post subject:

If you're pulsing a line to switch which multiplexed line you're reading, how do you know where the reset is? Do you at least use the other data line to reset the counter or something?

Edit: Oh, I see the line at the end. But why not use the second (unused?) data line for that?
_________________


Back to top
keoni29


Advanced Newbie


Joined: 18 Feb 2012
Posts: 41

Posted: 13 Jul 2012 01:58:41 am    Post subject:

KermMartian wrote:
If you're pulsing a line to switch which multiplexed line you're reading, how do you know where the reset is? Do you at least use the other data line to reset the counter or something?

Edit: Oh, I see the line at the end. But why not use the second (unused?) data line for that?

The second data line is for receiving data directly from the multiplexers output as it is not processed by the microcontroller (no spare pins left). I could have added a latch, but I wanted to keep the parts count as low as possible. At the moment I only have 4 parts:
AtTiny45
4051 multiplexer
Switch
Battery
The pullup resistors are on the board of the gamepad itself. I figured that the programmers would read the keypresses every cycle of the program loop and store them in an array. Reset is not needed.
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55760
Location: Earth, Sol, Milky Way

Posted: 14 Jul 2012 08:37:02 am    Post subject:

I agree that reset wouldn't need to be used often, but I would want the peace of mind of knowing that I was indeed incrementing to the key I thought I was incrementing to. Smile
_________________


Back to top
blue_bear_94


Member


Joined: 20 Apr 2012
Posts: 162

Posted: 16 Jul 2012 08:50:25 am    Post subject:

Would it be possible to do the opposite: use your calculator as a gamepad?
_________________
Do NOT click any links!
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55760
Location: Earth, Sol, Milky Way

Posted: 16 Jul 2012 10:31:54 am    Post subject:

blue_bear_94 wrote:
Would it be possible to do the opposite: use your calculator as a gamepad?
It definitely would, and it's something that people like BrandonW have experimented with in the past. With clever ASM, the TI-84+/SE can be made to look like a USB gamepad to a computer.
_________________


Back to top
keoni29


Advanced Newbie


Joined: 18 Feb 2012
Posts: 41

Posted: 17 Jul 2012 05:01:26 am    Post subject:

How about using it as a keypad for the emulator? Very Happy Very Happy Very Happy
_________________
Back to top
KermMartian


Site Admin


Joined: 14 Mar 2005
Posts: 55760
Location: Earth, Sol, Milky Way

Posted: 17 Jul 2012 08:36:18 am    Post subject:

keoni29 wrote:
How about using it as a keypad for the emulator? Very Happy Very Happy Very Happy
Both BrandonW and Benryves have done that, as far as I know. I'd have to track down the page(s) on their respective websites.
_________________


Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are GMT - 5 Hours

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© Copyright 2000-2013 Cemetech & Kerm Martian :: Page Execution Time: 0.034254 seconds.