PicoLCD

From Wildsong
Revision as of 07:02, 26 July 2015 by Brian Wilson (talk | contribs)
Jump to navigationJump to search

There are several displays going by the PicoLCD name, I have the 20 character, 2 line version (20x2). It connects to the host as a USB HID device.

The folks at Mini-Box were kind enough to respond with both schematics and source code for my PicoLCD 20x2 display. They have everything up on their web page now, see http://www.mini-box.com/picoLCD-20x2-OEM

Now I can do something fun with it. Well. Let's say "More fun." I was already able to get it going on 8track with the generic lcd4linux program, but I want to be able to use all the extra ports on it. What I have in mind requires programming the actual board.

Features

LCD: 20 characters wide, 2 rows, with backlight
CPU: Microchip 18F4550 (Microchip page)
This chip has 32K of Flash, 2K RAM, a 13 channel 10-bit ADC, a couple comparators, and of course the 11Mbps USB port.
One bit switch
64k EEPROM
IR port

There are many interesting features on this board considering on the surface it's just a 20x2 LCD. A companion product from Mini-box is a board with buttons and an IR receiver on it. I don't have one of those, and it would not fit in 8track anyway.

One bit switch NC7SZ384: The board has connectors for "power in", "power out", and a "power button". The power in and and out are wired up to the switch. The "power button" is simply connected to a port on the CPU. From the docs I think Mini-box intended this to work with the host PC power connections.

Connection to host system

There are cables available but alas I neglected to order any.

The Mini-box docs show a 5 pin connection, but my board has only 4 pins, no ground wire so I ignore that connection. On my Epia motherboard I connected to the on board USB using a 6 pin cable that I had handy. The Epia gives me 4 options, I choose a set up that leave the other three available. It looks like this

LCD    CABLE  EPIA
        
1 V+   6 YE    10
2 D-   5 GN    12
3 D+   4 WH    14
4 V-   3 BK    16
5 GND  2 OR    nc
       1 RD    nc

Using the PicoLCD with lcd4linux

Not going to go into a lot of detail here, but this is available for most Linux distributions and it supports the PicoLCD 20x2.

You have to enable the 20x2 by commenting out the default setup line and uncommented the 20x2 line in the lcd4linux config file.

Then you can pick and choose what you want displayed from the included tools or write scripts for lcd4linux to run.

Working with the SDK

Mini-box provides an SDK so that you can write your own host-based code. The SDK includes a simple sample program.

You can use the sample program instead of lcd4linux if you don't want to do programming.

Programming the PicoLCD

You need a development system to run Microchip's PIC development tools. I use the MPLAB X version on Linux. I use the XC 8 compiler. All free now.

Port assignments

RA0
RA1
RA2 PWR0 output controls power switch
RA3 PWR1 input push button "power"
RA4
RB5
RB0 I2C SDA input
RB1 I2C SCK input
RB2
RB3 LCD BIAS output
RC4 USB D- output
RC5 USB D+ input
RC6 SERIAL TX output
RC7
RD0 ROW1 output
RD1 ROW2 output
RD2 ROW3 output
RD3 ROW4 output
RE0 LCD RS output
RE1 LCD EN output
RE2 LCD Backlight output
RE3 LCD BIAS output

Power switch

There is a NC7SZ384 power switch on the board that can switch up to 128 ma and 0-7v. It is on port RB4; you can turn on and off some accessory of your choice using this switch. There is a "power button" on RB5, it's just another pushbutton grouped with the power switch.