
When this thing is finished I want to have a menu
driven mount that
accepts numbers both for coordinates and also for commands. It will be
important for the operator to be able to get feedback from the
controller on what is happening. I needed a backlit lcd screen that
would display plenty of text for these purposes. Standard backlit
multiline text LCDs are reasonably expensive and quite limited. I found
a
full
colour VGA screen on Dontronics for $AU55 called the uLCD,
and this is what I am using.
The interface to this screen is simple. It consists of a two wire
serial interface that carries commands consisting of ascii character
strings. Well that is the theory. I had a great deal of trouble getting
this to work and none of it the blame of the product. The Picaxe runs
at a logic level of +5v. My power supply was pushing that to around
+5.3v. The uLCD runs at a logic level of +3.3v. The uLCD is
designed to interface to 5v logic levels as well as 3.3v - it is
clearly
documented to add 1K resisters in series to the RX and TX lines. The
uLCD clamps the voltage to 3.3v and it should work without trouble.
However my power supply was out just enough to cause communications
problems.
In addition to power issues, one output pin on my Picaxe will not do
serial comms. I must have damaged it somehow. Of course Murphy's law
says that that was the pin I was using. These things together with my
poor soldering, broken wires in my hookup cable etc, it took me a month
to get this working. I have included my log below. My thanks to Atilla
of 4D Systems who make the uLCD and to Hippy of the Picaxe forum for
their patient help in sorting me out.
Hardware wise there is nothing to hooking up the uLCD. Hookup power and
ground. Connect the TX pin on the uLCD to an input pin on the Picaxe
through a 1K resistor and the RX pin to an output pin through a 1K
resistor. The biggest issues are power.
Power
The
uLCD is sensitive to logic level which is in turn controlled by the
accuracy of Vcc. The best way to ensure accurate +5v is to use a 7805
voltage
regulator.
This three leg IC will take a range of voltages and output clean +5v.
Eventually I will run it from 12 volt. Currently I am driving it from a
9v rated wall wart that I found in the cupboard. The voltage in needs
to be a bit higher than than 5volts. The datasheet I had suggested at
least 7.5v. If you are running this at high voltages you might need to
add a heatsink. For 12v I expect I will have no problems.
The regulator also requires two capacitors on either side. The rating
of these caps varies depending on who you talk to. I used 100nF caps on
the advice of Hippy of the Picaxe forum.
I also added 100nF caps across the power to ground on the Picaxe - both
connections- and across the power of the uLCD. These caps are generally
applied to smooth out power fluctuations. They act like a hammer
arrestor in plumbing. When the current goes up, they suck it in and
store it, when it goes down they spit it out again. This happens fast
smoothing the power.
Serial Comms
The logic levels on the uLCD are high=1,low=0 so all serout/serin
commands should use the T series of speeds eg T1200 for those commands.
In addition, for relability raise the output pin to high before sending
the command.
Components:
| 7805 |
| 5 or more 100nF capacitors |
| 2x1K Resistors |
| uLCD-128 |
| 4 pin plugs, sockets and cable |
Here is the specific
schematic.
Testing software can be found on the
software
page.
Issues Log:
1) didn't know which type N or T
2) couldn't get it to work at all.
3) sent back to Atilla. Worked fine for him. He checked the circuit
schematic said ok.
4) rewired the connection. Tried pullup, pull down resisters. Redid the
cable.
finally moved to different output pin - worked.
5) not getting acks back. Shifted to another pin - still no acks - just
0s.
pulled pin low, then high with same results
6) downed the voltage to 3.3v. Got acks back.
7) advised by hippy to go to rectified 5v from wallwart. did and it
worked.
8) moved input back to planned pin. didn't work. moved back to working
pin - didn't work. Suspicion
issues with emr from notebook. tried again keeping clear of notebook.
9) noticed that one wire in cable broken. Fixed the wire. It worked
10) shifted the input back to the planned pin and it worked
11) shifted the output back to the planned pin. Didn't work.
Fiddled for a while and gave up.
12) moved back to the working pin and tested ok.