LCD Outputs and Bi-Color LEDs

chopperwalker

New Member
Does anyone know if you can run a bi-color led with two outputs like they do in the Picaxe Manual 3 with a Wulfden LCD pack and Phanderson's 2400 baud chip?

Ran out of wires in my bundle and Im trying to pack more features in.

I read that the outputs on the phanderson chip can source or sink 15 ma; thats the key right?
 

westaust55

Moderator
Not sure that I completely follow your logic/requirements.

Are you trying to drive and LCD module as well as some bi-colour LED's?

An LCD driver typically has 4 data bits and two control signals to the LCD display module. Sure, if the LCD driver chip/module you mention can handle 15mA as you say (I have not searched for datasheets) and you use series resistors to limit the current to a max of say 10mA (maybe 390 or 470 ohm series resistors) then you could handle a couple of bi-colour LED's


If you are only intending to drive some bi-colour LED's and want to use minimal PICAXE pins there are several alternate ways that could be better.

How many bi-colour LED's are you trying to control?


Which PICAXE chip do you have or intend to use?
an X/X1/X2 part can use i2c IO expanders for the task.
other chips can use shift registers - eg 74HC595 (3 wires), 74HC164 (2-wires but ripple on LED's)

Given some additional information, members here can guide you to a good solution.
 
Last edited:

Andrew Cowan

Senior Member
I've used that board with an LCD pack, and seem to remember you do get a few general purpose outputs. However, I'd recommend using a (three legged) tri-colour LED, as these do not require the leds to source then to sink current.

Middle leg to ground, the other two to the outputs.

A
 

westaust55

Moderator
Just pulled up the Wulfden K107R LCD board manual.
http://wulfden.org/downloads/manuals/K107manual.pdf

there are 4 outputs terminals as Andrew mentions. From the schematic, two are dedicated for outputs and two are shared with the LCD signals.
Thus would think that the latter two will thereforesflicker when there are comms to the LCD module.

Then seems how the baord is wired determines whether you actually have two or four outputs available.
 

chopperwalker

New Member
I have a 20x2 in one box. I am using a 7 wire cable from the box to another to handle a LCD (+,-,signal) and three inputs, which is 6 of the the 7 wires. My board has 4 general purpose outputs. I am pretty sure it is wired for all four to be outputs, but I don't recall. I have one wire left and basically no space left in either box for much more electronics. I have also used almost all of the pins on the 20x2 and the two left I am saving for expansion.
My idea was to have a status indicator for my system using a bicolor LED and two output pins from the LCD (green means program running, red flash means alarm, off means program off).
I have a tricolor laying around, but seems like overkill since I only have the three states (and I couldn't use the all of the colors anyway since my outputs are simply high/low). I would also have to confirm I have four working outputs and not two. However, it is a good alternative.

From the LCD manual:
On power up, all outputs are at a high impedance (configured as inputs). As each output is addressed,
it is taken out of the high impedance state. The initial high impedance state permits the user to use either pull up or pull down resistors to avoid “bounce” when the processor is powered up.The current (source or sink) by any output should be limited to 15 mA.
From Picaxe Manual 3:
Bi-colour LEDs often contain both green and red LEDs connected in ‘inverse parallel’.
This means if current flows one way through the device the LED lights green, and if
current flows the other way the LED lights red. Therefore by using the sink/source
capabilities of the PIC Microcontroller it is possible to light the LED in both colours.
If I understand the above then it should work right? If not, can I damage my LCD pack by trying this (if I use the resistors westaust55 suggested)?
 

westaust55

Moderator
If I understand the above then it should work right?
If not, can I damage my LCD pack by trying this (if I use the resistors westaust55 suggested)?
A1. It should work

A2. If connected correctly and with the current limiting resistor then you will not damage the LCD pack.

You can always draw your intended schemtic and post here and once wired take a photo if you need more assurance.
 

chopperwalker

New Member
Gave it try and it worked perfectly. k107 output 4 to 330 ohm resistor to led to output 5.

Same programing as the picaxe manual
but in the LCD code

green:
serout LCD,T2400,("?H4?L5")

red:
serout LCD,T2400,("?L4?H5")

off:
serout LCD,T2400,("?L4?L5")

Thanks for the input
 
Top