put the keypad matrix system into Key Up/Down Mode.
In this mode, the panel does not send characters
continually while the key is depressed. Instead, it senses a
key press and immediately sends the character associated
with the key. No other characters will be transmitted until
the key that is being depressed is released. Here’s the
command code to put in for Key Up/Down Mode:
printf(“%c%c%c”,0xFE,0x7E,0x01);
LOST IN THE WOODS AT
NIGHT IN THE RAIN
It’s obvious that the GLK240128-25 is designed to
be easy to deploy. I had absolutely no problems with the
hardware or the MOGD# application. However, I did run
into a gotcha with the RS-232 interface.
My initial PIC hardware design was driven by a 20
MHz ceramic oscillator. The PIC18F2620 showed no signs
of any abnormality and its EUSART did not exhibit any
problems when communicating with my Tera Term Pro
emulator. However, I could not communicate with the
GLK240128-25 RS-232 port reliably at any of its supported
baud rates. I figured I had a bogus unit. I happened to
have two of them and swapping in a new unit didn’t
change a thing. So, I placed a call to Matrix Orbital’s
support center and began a problem-solving conversation
with Troy Clark. Troy was very supportive and was always
available to take my calls.
After several days of emails and phone calls to Troy, I
narrowed the problem down to the ceramic oscillator that
I was using to clock the PIC18F2620. There was absolutely
no science or logic associated with finding the root cause
of the problem. I stumbled into the fix. In complete
desperation, I replaced the 20 MHz ceramic oscillator
with a 20 MHz crystal and the panel never lost another
THE DESIGN CYCLE
SOURCES
Matrix Orbital — www.matrixorbital.com
Matrix Orbital GLK240128-25; MOGD#
HI-TECH Software — www.htsoft.com
HI-TECH PICC- 18 PRO
Microchip — www.microchip.com
PIC18F2620; MPLAB IDE
character when communicating with the PIC18F2620. I
won’t disparage the ceramic oscillator manufacturer here
as my problem may be an isolated incident. Needless to
say, I trashed my stock of that manufacturer’s ceramic
oscillator devices.
WRAP-UP
You have been exposed to a pair of methods
(sendchar and printf) that allow you to exploit the full
feature set of the Matrix Orbital GLK240128-25. The
sendchar method is more suited for smaller applications
that are being driven by PIC microcontrollers with limited
memory resources. PIC microcontrollers with larger
program memory areas can take advantage of the printf
command method.
We’ve only scratched the surface of this panel’s capabilities. Reading about what it can do does not do this
LCD panel justice. I’ve given you a firmware jump start on
putting one to work. To get a feel for how versatile the
GLK240128-25 really is, you’ll just have to get a one of
your own and meld it into your Design Cycle. NV
CONTACT THE AUTHOR
■ Fred Eady can be contacted via email at fred@edtp.com.
Order online at:
www.melabs.com
Development Tools for PIC® MCUs
microEngineering Labs, Inc.
Phone: (719) 520-5323
Fax: (719) 520-1867
Box 60039
Colorado Springs, CO 80960
hown)
V)
E
W
P
B
S
B
PICBASIC P
With Accessories for $119.95:
November 2008 75