Home | Store | Showcase | Forums | Examples | Guides | Reviews | Support | Download | About Us

 

 

Connecting a PC1202 LCD Display to the DevBoard-M32

 
We now stock a small, affordable LCD display that is very easy to use with the DevBoard-M32. It can be  interfaced directly to the M32 without any other components.

About the PC1202-A

This compact display has 2 rows of 12 characters and has an LED backlight.  It has 4 notches for screw mounting and a ribbon cable connector that's about 4" long.   The display requires a single 5v power supply including the voltage for contrast. This removes the need for a power inverter to produce a negative voltage.

6 I/O lines, 3 ground connections and 2 power connections are needed to operate the PC1202-A. All of these connections are available on the M32.

To use the PC1202-A with the M32, you need to:

  • Modify the LCD Connector
  • Connect the LCD to the DevBoard-M32
  • Program the DevBoard-M32


BUY NOW

Modify the LCD Connector

You can keep the 2x8 IDC connector if you like, but for this example, I am going to remove it  and use crimp connectors that can plug directly into the DevBoard-M32. You could also plug a 2x8 male header into the connector and extend wires to the M32.

The first step is to cut off the connector and separate the wires.

 


Step1

 

  We only use 4 of the data lines, so we can remove the 4 other data lines, 7-10.


Step 2

 

 
  Next, strip the ends and crimp on standard square post MT connectors. These will plug onto the square post headers on the M32.


Step 3

 

 
  Arrange the lines into groups if you have MT housings - group the lines as shown in the picture.

Lines 1,3, 5 into a 3-pin housing (Plug into the Ground pins on the power bus). 

Note: Pin 3 is the display contrast. Typically grounding this pin provides the correct contrast if the backlight is on. If you don't see any text or the text is black boxes, you may need to connect a variable resistor to this line. Connect on leg of the variable resistor to +5v and the other to ground. Then connect the wiper to Pin 3 on the LCD.

Lines 2 & 15 into a 2-pin housing (Plug into the +5V pin on the power bus)

Lines 4 & 6 into a 2-pin housing (Plug into the I/O header)

Lines 11,12,13,14 into a 4-pin housing (Plug into the I/O header)

 


Step 4

 

 
  Connect to the DevBoard-M32

Connect the lines as shown in the table below:
 

1 (Brown) GND 9 (White) NC
2 (Red) +5V 10 (Black NC
3 (Orange) GND 11 (Brown) PortC.2
4 (Yellow) PortC.4 12 (Red) PortC.1
5 (Green) GND 13 (Orange) PortC.0
6 (Blue) PortC.3 14 (Yellow) PortD.7
7 (Purple) NC 15 (Green) +5V
8 (Gray) NC  

 


Step 5

 
  Program the DevBoard-M32

Once the hardware is connected, use the code listed below to test it

   
  'PC-1202-A LCD Example Program
'Wright Hobbies,LLC
'http://www.wrighthobbies.net

'Dimension Variables
Dim Text(10) As String * 12
Dim I As Byte

'Configure the type of LCD Display
'The display is has 12 viewable characters
'but the chipset uses 16 characters
Config Lcd = 16 * 2

'Configure the pins used for the LCD display
Config Lcdpin = Pin , Db4 = Portc.2 , Db5 = Portc.1 , Db6 = Portc.0 , Db7 = Portd.7 , E = Portc.3 , Rs = Portc.4

'Prep the LCD Display
Cls
Cursor Off

'Define the Text Messages
Text(1) = "DevBoard-M32"
Text(2) = "Small, Fast "
Text(3) = "& Affordable"
Text(4) = "Robotics "
Text(5) = "Controller "
Text(6) = "Based on the"
Text(7) = "Atmel AVR "
Text(8) = "ATMega-32 "
Text(9) = " "
Text(10) = " "

'Main Program

Do
For I = 1 To 9 Step 2
Locate 1 , 1    'Row 1, Column 1
Lcd Text(i)     'Display the first row text
Locate 2 , 1    'Row 2, Column 2
Lcd Text(i + 1) 'Display the 2nd row text
Wait 2          'Wait 2 seconds
Next I
Loop

End