Connecting a 16-key keypad to VIA: Did I do it right?

For discussing the 65xx hardware itself or electronics projects.
User avatar
Proxy
Posts: 746
Joined: 03 Aug 2018
Location: Germany

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by Proxy »

I love the "no escape" key, it's very ominous! :lol:

on the note of that IR remote. i wonder if you could decode the signal in software with just a VIA (for example IRQ on the first low pulse, then stay in ISR until the whole thing is read). even at a measly 1MHz that seems pretty doable.
User avatar
Dr Jefyll
Posts: 3526
Joined: 11 Dec 2009
Location: Ontario, Canada
Contact:

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by Dr Jefyll »

GARTHWILSON wrote:
Just use a 4x4 with one of the keys being a shift key.
Yup. :) Or -- similarly -- the monitor facility on my KK Computer has a shift function, but shift is invoked using a pushbutton that's external to the keypad. Thus the hex digits from 0 to F can all directly appear on the keypad itself.

I chose to have shift-A mean, "switch to Address entry mode." Shift-D means, "switch to Data entry mode," and shift-E means Execute starting at the currently displayed address. The other keys also have a "shift" interpretation, but I can't remember what they are -- I would have to refer to my records! :lol: :oops:

(Oh -- and the other red pushbutton is reset. I trimmed its plastic knob because I wanted reset to be more difficult to actuate.)

Welcome, Jeff!

-- Jeff
Attachments
KK keypad.jpg
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html
User avatar
JeffJetton
Posts: 6
Joined: 18 Mar 2024
Location: Nashville, Tennessee, USA
Contact:

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by JeffJetton »

Michael wrote:
One possible low-cost solution, if I may? I've used some 24-key and 44-key IR Remotes in PIC projects in the past. The IR Receiver IC comes with the keypad and only needs a single pin and pull-up on the host. The NEC IR protocol is relatively easy to decode and you can print custom keypad overlays.
Oooh, interesting! Maybe a bit too much for this current project, but something I might want to play around with for something later.
User avatar
JeffJetton
Posts: 6
Joined: 18 Mar 2024
Location: Nashville, Tennessee, USA
Contact:

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by JeffJetton »

Dr Jefyll wrote:
Welcome, Jeff!
Jeffs unite! 8)
User avatar
GARTHWILSON
Forum Moderator
Posts: 8775
Joined: 30 Aug 2002
Location: Southern California
Contact:

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by GARTHWILSON »

Proxy wrote:
I love the "no escape" key, it's very ominous! :lol:
I hadn't thought of it that way, but yes, it's funny when you put it that way.  I started using a key for YES / ENTER / CONTinue and another key for NO / CANCEL / ESCape / EXIT and another for MENU / HELP (or press the YES key and the NO key simultaneously for MENU / HELP), plus cursor keys or a 2-bit gray code rotary switch to scroll through menu items or even characters to enter, in the late 1980's, and you can see it on the keypad for the automated test equipment I did at my last place of work, around 1990, at http://6502.org/users/garth/projects.php?project=6 .  Although it's slower than having a full keyboard, you can do virtually anything with it, and it's very easy to learn.
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
fachat
Posts: 1124
Joined: 05 Jul 2005
Location: near Heidelberg, Germany
Contact:

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by fachat »

Regarding Infrared control. Yes you can http://www.6502.org/users/andre/icaphw/remote.html
Caveat: that was many years ago and IR remote controls may have changed.
Author of the GeckOS multitasking operating system, the usb65 stack, designer of the Micro-PET and many more 6502 content: http://6502.org/users/andre/
User avatar
drogon
Posts: 1671
Joined: 14 Feb 2018
Location: Scotland
Contact:

Re: Connecting a 16-key keypad to VIA: Did I do it right?

Post by drogon »

IR keypads - great idea - I should have thought it that for a project I'm looking at - moreso as I've used them in the past...

The easiest thing these days for receiving IR is to use a dedicated IR detector and demodulator. All remotes (TV, Radio, Keypad for your RGB LEDs, etc.) use a modulated signalling method - the modulated signal is anywhere from 30Khz to about 56Khz - and ideally you need to match the receiver to the transmitter. I have used the TSOP38236 receiver in the past - those last 2 digits are the frequency, 36 here means the carrier is 36Khz.

That then gives you the bit-stream from the sending device.

I wrote some code for an ATmega MCU a few years back (all in C) and my strategy was to sample the incoming bits (actually the time between bit changes - the input pin triggering an interrupt on falling edges) into a buffer then analyse the buffer for various start bits, bits to skip and the bit pattern that represents a logic 1 and logic 1. A 64 byte buffer was big enough for all the controllers I tried. (The timestamps were 8 bits wide). When trying a new controller, I'd put the code into "discovery" mode where it did the 64 samples then just printed them on the screen where it was relatively easy to work out the magic numbers. I'm sure there may be a better way but this worked extremely well.

Also a good test of the transmitter is to point it at your mobile phone in camera mode. You ought to see the IR LED light up.

-Gordon
--
Gordon Henderson.
See my Ruby 6502 and 65816 SBC projects here: https://projects.drogon.net/ruby/
Post Reply