CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / Projects / ColorMax MMStick Projects / CGKEYCHIP Custom Keypad

CGKEYCHIP Custom Keypad

CGKEYCHIP1

The Maximite design uses a PS/2 connection as a keyboard interface. You can use a full keyboard connected to either a CGCOLORMAX or the CGMMSTICK.

If you want to embed either of these two setups into a project, you might choose to replace the full keyboard with something either more compact or custom for your application. The CGKEYCHIP1 wired into a “ColorMax” or “stick” lets you create your own keyboard by adding your own buttons.

The CGKEYCHIP1 is a 24 pin chip in a DIP (through-hole) package. Four wires connect to the Maximite that include ground, power, and the two PS/2 communication signals (data/clock). You can wire in twelve distinct buttons for the keyboard keys plus three “modifier” buttons.

The CGKEYCHIP1 has two sets of keys that it can transmit:

Set1
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12

Set2
Up Arrow
Down Arrow
Left Arrow
Right Arrow
Space Bar
Page Up
Page Down
Enter
End
Home
Tab
Backspace

An input pin on the chip selects between these sets of keys.

The CGKEYCHIP1 runs off of the 5V that the PS/2 connection provides. Both chip grounds should be connected to ground. The pins marked “NoConnect” should not be connected to anything.

Supplied with the CGKEYCHIP1 is a 1.3 kohm resistor that has to be connected from pin 11 to pin 15 for the chip to operate correctly

The PS/2 data signals are open-collector signals. When you connect the GCKEYCHIP to a CGCOLORMAX there are pull up resistors already on the ColorMax. When you connect to a CGMMSTICK and CGVGAKBD1 combination, the CGVGAKBD1 board already has pull up resistors in place for the two PS/2 lines. No additional resistors are needed in this case.

CGKEYCHIP1 pinout.

When you connect the CGKEYCHIP1 to just a CGMMSTICK, you will need to attach two pull-up resistors in order to have the chip function correctly. Each of the two PS/2 lines should be pulled to 5V through a 10 kohm resistor.

Example CGKEYCHIP1 schematic.

The SetSelect input to the CGKEYCHIP1 selects the key set that you wish to use, either set 1 or set 2. Connecting this input directly to 5V will select set 1, while connecting this input to ground selects set 2.

The key inputs are activated by momentary contact to ground. Simple SPST buttons can be used.

You can write a very simple MMBasic program to check the codes that the keys transmit against the list of codes found in this document:


1
2
3
4
5
6
do
  a$ = inkey$
  if a$ <> "" then
    print asc(a$)
  endif
loop


When run, set 1 will return these codes:

Key

Plain

Control

Shift

Shift+Control

F1

145

209

177

241

F2

146

210

178

242

F3

147

211

179

243

F4

148

212

180

244

F5

149

213

181

245

F6

150

214

182

246

F7

151

215

183

247

F8

152

216

184

248

F9

153

217

185

249

F10

154

218

186

250

F11

155

219

187

251

F12

156

220

188

252

Set 2 returns these codes :

Key

Plain

Control

Up Arrow

128

192

Down Arrow

129

193

Left Arrow

130

194

Right Arrow

131

195

Space Bar

32

0

Page Up

136

200

Page Down

137

201

Enter

13

13

End

135

199

Home

134

198

Tab

9

9

Backspace

8

8

MMBasic interprets the Alt as a key by itself, not a modifier. The keycode for the Alt key is 139, Control-Alt is 203, Shift-Alt is 171, Control-Shift-Alt is 235. This program will return two key codes when Alt is used, first the Alt code, then the key code. Control-Shift-Alt-F1, for example, returns 235 241.

Example of circuit board ready for CGKEYCHIP1

 

 

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3
  • Re-energizing the ColorMax, Pt. 2
  • Re-energizing the ColorMax, Pt. 1
  • Workbench Retro Computer Pt. 3
  • Workbench Retro Computer Pt. 2
  • Workbench Retro Computer Pt. 1

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008-2018 CircuitGizmos, L.L.C. All rights reserved

Image already added

Copyright © 2019 · Generate Pro Theme on Genesis Framework · WordPress · Log in