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

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
VGA_Term_Char( 0x0D );
// load keyboard driver (this driver is already loaded by default, but this call can't hurt)
Keyboard_Load();
// enter infinite loop...
while(1)
} // end main
I have highlighted the little scanner that looks for the sequence “morpheous”. Try typing it in and see if it works!
Summary
This demos shows off how easy it is to access the PS/2 keyboard. If you have done
work with embedded systems, reading a PS/2 keyboard is always a challenge since it’s
such a slow device. Thus, the best solution is to use interrupts to detect bits sent by the
keyboard. However, this usually means that any other processes that are running on a
high speed interrupt will be interrupted which is tricky. However, with the Propeller
doing all the work on a separate processing core, reading the keyboard is trivial and
requires no processing load at the master’s end.
30.1.2 Mouse “ASCII Paint” Demo
This demo uses the mouse API to communicate with a local PS/2 mouse plugged into the PS/2 port via the Propeller’s
mouse. Make sure to plug your mouse into the Chameleon and get a good connection. This crude “ASCII Paint” demo
{
// read next key, return 0 (null if no key), wait for key press
while ( (key = Keyboard_Key()) == 0);
// build display string
if (key >= 32)
else
// position cursor
NTSC_SetXY(1, 4);
// print on NTSC terminal screen
NTSC_Term_Print(sbuffer);
NTSC_Term_Char( 0x0D );
// position cursor
VGA_SetXY(1, 4);
// print on VGA terminal screen
VGA_Term_Print(sbuffer);
VGA_Term_Char( 0x0D );
//////////////////////////////////////////////////////////////////////////////////
// little string compare state machine for fun, when user types in access code
// it displays a little message at bottom
if (key == access_code[ access_code_index ])
else // reset access code, start over
//////////////////////////////////////////////////////////////////////////////////
// slow things down a bit, so we can read the text!
DELAY_MS(10);
} // end while
access_code_index = 0;
sprintf(sbuffer, "Key Code = %d [%c]
sprintf(sbuffer, "Key Code = %d [non-printable]
{
// consume character, test for match?
if (++access_code_index == strlen(access_code))
} // end end if
{
NTSC_SetXY(1, 22);
NTSC_Term_Print("Welcome NEO...Access Granted.");
VGA_SetXY(1, 14);
VGA_Term_Print("Welcome NEO...Access Granted.");
access_code_index = 0;
} // end if match
© 2009 NURVE NETWORKS LLC “Exploring the Chameleon PIC 16-Bit”
", (int)key, (char)key);
", (int)key);
222

Related parts for Chameleon-PIC