Page 2 of 2
Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Wed Mar 20, 2024 9:10 pm
by Proxy
I love the "no escape" key, it's very ominous!
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.
Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Thu Mar 21, 2024 12:55 am
by Dr Jefyll
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!
(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
Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Thu Mar 21, 2024 2:48 am
by JeffJetton
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.
Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Thu Mar 21, 2024 2:49 am
by JeffJetton
Jeffs unite!

Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Thu Mar 21, 2024 2:57 am
by GARTHWILSON
I love the "no escape" key, it's very ominous!
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.
Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Thu Mar 21, 2024 12:50 pm
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.
Re: Connecting a 16-key keypad to VIA: Did I do it right?
Posted: Thu Mar 21, 2024 1:48 pm
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