Chameleon-PIC Nurve Networks, Chameleon-PIC Datasheet - Page 198

MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)

Chameleon-PIC

Manufacturer Part Number
Chameleon-PIC
Description
MCU, MPU & DSP Development Tools PIC24 & PROPELLER DEV SYSTEM (SBC)
Manufacturer
Nurve Networks
Datasheet

Specifications of Chameleon-PIC

Processor To Be Evaluated
PIC24
Data Bus Width
16 bit
Interface Type
USB, VGA, PS/2, I2C, ISP, SPI
Operating Supply Voltage
3.3 V, 5 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
24.0 Keyboard Library Module Primer
The basic premise of the Chameleon design is that it leverages drivers running on the Propeller chip to do all the media
and graphics. Thus, whatever features the particular driver running on the Propeller side does is the only features we can
access via the PIC side. That doesn’t mean we can’t abstract functionality and add higher level functions that build on the
sub-functions, however, this probably isn’t productive since you will want to change drivers, re-write the Propeller driver
and so forth. Thus, for the majority of the “media/IO” drivers all the API functions do (including the Keyboard) is expose
some of the base functionality in nice function calls so you don’t have to send SPI messages yourself. Now, the one thing
about keyboards (and mice) is they are really SLOW, thus its typically a problem reading them, since your CPU has to
slow down to do so; therefore, it’s really nice for a core on the Propeller to completely handle the keyboard and queue up
keypresses for you.
For the keyboard, we decided to use a base driver from the original Propeller objects development that was designed to
communicate to a standard PS/2 keyboard, nothing fancy. The same driver is used in both Default1 and Default2, so the
same idea apply to either driver you load on the Propeller (CHAM_DEFAULT1_DRV_112.SPIN or
CHAM_DEFAULT2_DRV_112.SPIN). The actual driver object used for the keyboard is:
However, I only exposed a portion of its abilities thru the current SPI messages, no need to waste messages. You can
always add more. Therefore, the abilities you see exposed in the following API are just a taste of what it can do. In other
words, if you need more functions that the driver supports then you will have to add messages to the SPI driver and add
them yourself.
With that in mind, if you want to use the keyboard driver then you need the following files added to your project:
24.1 Header File Contents Overview
The “Keyboard” module header CHAM_PIC_KEYBOARD_DRV_V010.h has no #defines or globals itself since it literally
nothing more than wrapper functions that call thru to the Propeller side driver. But, it’s worthwhile to take a look at some of
the constants in the actual Spin/ASM code keyboard driver – KEYBOARD_010.spin. There are two very large tables at
the end of the driver that define the keys in terms of scan codes and ASCII codes. The tables are too long to list, but
here’s a excerpt from the first table:
' Lookup table
'
'
table
keyboard_010.spin – Basic PS/2 keyboard driver originally written by Parallax.
CHAM_PIC_KEYBOARD_DRV_V010.c
CHAM_PIC_KEYBOARD_DRV_V010.h
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
word
ascii
$0000
$00D8
$0000
$00D4
$00D2
$00D0
$00D1
$00DB
$0000
$00D9
$00D7
$00D5
$00D3
$0009
$0060
$0000
$0000
$F5F4
$00F0
$0000
$F3F2
$0071
$0031
$0000
$0000
$0000
$007A
scan
'00
'01
'02
'03
'04
'05
'06
'07
'08
'09
'0A
'0B
'0C
'0D
'0E
'0F
'10
'11
'12
'13
'14
'15
'16
'17
'18
'19
'1A
extkey
Alt-R
Ctrl-R
- Main C file source for “Keyboard” module.
- Header file for “Keyboard” module.
regkey
F9
F5
F3
F1
F2
F12
F10
F8
F6
F4
Tab
`
Alt-L
Shift-L
Ctrl-L
q
1
z
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
()=keypad
198

Related parts for Chameleon-PIC