Keypad control of 100+ leds

john thorne

New Member
I want to enter a number on a keypad to light a one specific led out of over 100 leds.
I am trying to use a ST4550 led driver with a picaxe 18m. Any hints. Thanks
 

westaust55

Moderator
Welcome to the PICAXE forum.

Can you please provide a link to the datasheet for the ST4550 LED driver.
A sinple search with "ST4550 datasheet" and similar found nothing.

Since you have selected that LED driver, what circuit and program have you come up with to date?
You could post your circuit diagram and code as a starting point.
 

hippy

Ex-Staff (retired)
The first step is to break the project down into its constituent parts -

Control of the LED's
Handling of the keyboard
Using keyboard results to control the LED's

Those parts can be broken down into further sub-parts. Much like 'building a house' comprises of laying foundations, building walls, fitting windows and roofs and each of those can be defined in more detail. Master each detail and the whole will come together.

As well as where you've got to, program and circuit so far, some indication of past electronic and programming experience will be useful, will help others to target their responses to the most suitable level.
 

eclectic

Moderator
Thanks for the reply.
This is a link to the led driver.
http://www.st.com/stonline/products/literature/od/10411.pdf
I have 3 of these daisy chained to give 102 outputs.
I am trying to pass the output from the keypad to the picaxe and then to the led driver using the shiftout command. I have good electronic experience but much less programming skills.
Any help is much appreciated.
1. Please do a search using the term
M5450
There are several mentions in the archives.

2. Can you supply your current circuit and program?

e
 

westaust55

Moderator
@MJT,

Not only was the “M” missing but the wrong digits to the part number did not help.

You do not state which PICAXE chip you will be using. :confused:

Exactly how your BASIC program will be structured will depend upon which PICAXE chip you are using.
For the X1 and X2 parts, there is the SHIFTOUT command built into firmware, but for other currently available PICAXE chip s you will need to use a subroutine similar to that at the bottom of page 192 in the current (V6.9) PICAXE manual part 2.

You could even have a look at some similar projects using multiple 74HC595 chips for software. For example: http://www.picaxeforum.co.uk/showthread.php?t=13687

You will also need to generate start pulses that the SHIFTOUT commands does not do but that is relatively simple and should already be covered in the several other threads covering the ST Electronics M5450 as mentioned by eclectic.
 

lanternfish

Senior Member
Thanks for the reply.
This is a link to the led driver.
http://www.st.com/stonline/products/literature/od/10411.pdf
I have 3 of these daisy chained to give 102 outputs.
I am trying to pass the output from the keypad to the picaxe and then to the led driver using the shiftout command. I have good electronic experience but much less programming skills.
Any help is much appreciated.
I had a look at the datasheet but cannot see how you could have daisy chained them as there is no data out pin.

As regards 'daisy chaining' such a scheme couldn't work as the internal registers reset on the high-to-low transition of the 36th clock pulse.

From the datasheet:

At the 36th clock a LOAD signal is generated synchronously with the high state of the clock, which loads the 35 bits of the shift registers into the latches.
At the low state of the clock a RESET signal is generated which clears all the shift registers for the next set of data.


Can you put up a schematic of your circuit.
 

lanternfish

Senior Member
A suggestion for driving 3 ST M5450's is to use the shiftout/spiout command (Manual 2, pg 192) with a common data line for all 3 M5450's and seperate clock lines from the 18M to each M5450.

For example:

Code:
symbol mode = 1  ;MSBFirst_L(MSB first, idles low)
symbol sclk = 7  ;18M Output 7
symbol sdata1 = 6 ;18M Output 6
symbol sdata2 = 5 ;18M Output 5
symbol sdata3 = 4 ;18M Output 4

symbol data1 = b0  ;leds 1 - 8
symbol data2 = b1  ;leds 9 - 16
symbol data3 = b2  ;leds 17 - 24
symbol data4 = b3  ;leds 25 - 32
symbol data5 = b4  ;leds 33 - 34

Main:

high sclk
SPIOUT  sclk,sdata1,mode,(data1,data2,data3,data4,data5/2)  ;leds 1 - 34
SPIOUT  sclk,sdata2,mode,(data1,data2,data3,data4,data5/2)  ;leds 35 - 68
SPIOUT  sclk,sdata3,mode,(data1,data2,data3,data4,data5/2)  ;leds 69 - 102
low sclk
 
Last edited:

lanternfish

Senior Member
For the keyboard you could use a standard 12-key keypad

1 2 3
4 5 6
7 8 9
* 0 #

There are a number of descriptions of how to wire this up with resistors so that you can read it via an ADC pin.

For selecting a led via the keypad you could try:

press digit 0 - 9 (hundreds), 0 - 9 (tens), 0 - 9 (units) then # to enter
and * to clear if you make a mistake.

e.g. 038# = 38, 001# = 1, 100# = 100
 

MPep

Senior Member
A suggestion for driving 3 ST M5450's is to use the shiftout/spiout command (Manual 2, pg 192) with a common data line for all 3 M5450's and seperate clock lines from the 18M to each M5450.
The M5450 uses an /Enable line. Would be simpler to switch between M5450's this way, parallel all Clock and Serial Data lines together.
 

lanternfish

Senior Member
Hi MPep

Thought of that. Still uses 3 o/p's so why not use them for spi data?

Of course, could use two o/p's and a 74LS138 to select enables.

Cheers
 

john thorne

New Member
Thanks for your suggestions

Thanks for your suggestions that gives me plenty to go on.
I will experiment with the Picaxe, keypad and led drivers.
If I get stuck I will askfor more help.
If I solve it I will post the results.
Thanks again
 
Top