• Some users have recently had their accounts hijacked. It seems that the now defunct EVGA forums might have compromised your password there and seems many are using the same PW here. We would suggest you UPDATE YOUR PASSWORD and TURN ON 2FA for your account here to further secure it. None of the compromised accounts had 2FA turned on.
    Once you have enabled 2FA, your account will be updated soon to show a badge, letting other members know that you use 2FA to protect your account. This should be beneficial for everyone that uses FSFT.

keypad serial microcontroller? who wants to make some $$$

FLECOM

Modder(ator) & [H]ardest Folder Evar
Staff member
2FA
Joined
Jun 27, 2001
Messages
15,829
i have a 2x8 keypad with 2x8 LEDs (one per button, buttons and LEDs are in a matrix)

i need to run all the data of the button positions (they are momentary but i want to be able to keep sending the signal if i keep the button pressed) down a serial line and then the opposite for the LED's...

basically i need the 16 buttons to trigger 16 relays on the other end, and 16 lines on the relay end to turn on the LEDs on the keypad

and i can only use 6 pins from the keypad to the relay box

can anyone do this? I can post pics of the keypad so you get an idea of the PCB size im working with in a bit...

im starting to get desperate lol
 
fleet id love to help, but youll have to go into a little more detail. and im not taking any $


second, even if you only have 6, thats plenty of room for an IC^2 bus, or 2 or 3. even if you have to resort to old fassion RS232 its still pretty simple. you can easly use a serial keypad encoder and a serial LED driver with no MCU on the keypad side. that would require 1 data line, 1 CS line, and 1 clock line- you would only need 1 PIC on the relay card end with 4 serial quad relay driver chips. but why the bazzare limitations? please explain:

1)what do you meen "lines" on the relay end... digital, analouge, what voltage?
2)how fast do the relays need to be updated... every 10ms or every button press?
3)the switches themselfs are momentary, but how do you want them to act... latching, momentary?
4)is more then one button pressed at once?
5)where is the supply voltage coming from... relay end, switch/led end, both?
5a) if only one end... does power count towards the 6 pins?

and anything else i should know?
 
i found what you were looking for. on the keypad end:
MAX6955 "2-Wire Interfaced, 2.7V to 5.5V LED Display Drivers with GPIO and Key Scan"

then, depending on how good the 6955 is, you may or may not need a PIC to drive two:
MAX4820 "+5V, 8-Channel, Cascadable Relay Drivers with Serial Interface"

if i am reading the data sheet correctly, the 6955 may beable to do all the heavly lifting. you can order both chips as samples for realy cheap, or if you make up a company, free.
 
ok basically, my smart siren head died on me, so now im trying to make it more functional for my needs...

this is what it looks like

E5DD2871%20(Small).JPG


the bottom thumb lever is an of/on/on/on switch

this is the pcb

E5DD2875%20(Small).JPG


and the schematic (traced/toned it out)

ss2000.gif


all the buttons are momentary minus the thumb switch which is OFF/1/2/3 and has an LED for 1 2 and 3 which are leds 1 2 and 3 of the second row

basically i want each button to control a relay (or a small opto-isolator or something depending on the load i need) (on when the button is pressed), it would be nice if i could have a row of dip switches to select momemtary or push-on push-off

also as far as LED's they should all be lit dimly (except 1,2 and 3 of the second row) while the unit is on, and then go bright when the relay is on, so if its a momemtray just as your pressing it and if its a press-on press-off it should be on while the relay is closed, or another option would be for them to all be on (again minus 1 2 and 3 of the second row) and blink when they are pressed or the relay is closed or whatnot

led 1 2 and 3 of the second row should only be lit when the thumb switch is in that position

reason im offering $$$ is becuase i know nothing about PIC's or microcontrollers so i would need somone to help me with this project as far as programming and such

the reason for the 6 pin requirement is it uses a 6 pin phone cable (if i could cram in it 4 that would be nice too)

this has to go to the relay box that would be in the rear of the vehicle hence why i need to send all the data down such few lines
 
okay, the keypad is actualy 4x4, but thats okay.

it looks like an MCU and the encoders aready there, what broke? is any of it usable?
is it okay to have the PIC in the relay box?
do you want the pezeo to still work?
what does the thumbswitch do... power?
i take it you just want to keep the look of the old one, right?

with the MAX chip i can do flashing realy easily.

the momentary/constant is a programing thing, that can be set with jumpers or dip switches on either end, whatever works better for you. if you want to compleatly re-do the bottom board, thats fine, it will fit.
 
the thumb switch i have on there as S1 S2 S3 for the three possible positions (besides off)... S1-1 through S1-8 are the first row of buttons, and S2-1 through S2-6 is the second row

i would like to just not use the board with the micro, i dont mind having pics on either end but like i said, i have no facilities to program such devices... if i could keep a piezo that would be nice, all it does is beep when you press a button (not continous if you hold the button)
 
Not to rain on the parade here, but just curious... Have you investigated what the cause of the problem is with the original unit? More often than not some component in the power supply section is the cuplrit in my experience. You may find it easier, cheaper and quicker to diagnose and repair the problem than to go through the effort of designing (and debugging) an entirely new control system.

That said, it seems like theshadow27 has a good grip on the topic. Myself, I'm an Atmel AVR man, but if I could be of any help just shout. But it seems like some of your logic and feature requests do lean towards some type of mcu.

It seems to me that there must be some type of mcu or other logic decoding circuit at the other end; obviously the original controller did not operate all of those functions with only six wires. You may want to get an idea of what is going on there to see if you can make use of any of it.

Also, is there a specific need for the led's to be driven from the relay end? I would think they could just be controlled from whater logic you have for the buttons.

Also, fwiw I belive the 6 pin phone jacks are RJ25, you'll want to confirm whether they are pin-to-pin or inverted from end to end before you hook anything up to them.
 
problem with the other end its designed to swtich on and off huge +12v loads... and apparantly something got unhappy and its pretty much toasted, literally
 
fleet -- if you are willing to make and test teh PCB's i can mail you the PIC's with code on them.

to reduce the number of MCU's, you could use a duel-serial data line into 2 8bit shift registers at the relay end. these would need only 2 data lines and a clock, as well as 1 enable. this is 4 lines which would fit in a regular phone cord.

for the MCU end, its pretty much up to you as how to design it. if you use the MAX6955, you will still need 1 16F84 to coordinate the whole operation and clock the data in at the other end. however, the chip can directly read a 8x2 keypad (up to 8x8) and drive the 8x2 LED array (up to 8x16). the pezio could be activated directly off the MCU, or through the MAX using an optocoupler.

the other way would be a single 16F84 and one 8 bit shift register to feed the anode's for the LED array as well as the keypad matrix. with a shift reg and a few transistors, the only other major component is the 16F84. the code would have to be a tad bit more complex, but nothing the kids at [h] cant handle.

if we get working code, ill take responsibility for the programming and shipping, if you wish.
 
While I do not know much about PIC’s myself, ( I’m only to the easily basic programmable PICs ) I was looking at your problem and thinking of possible ways to transfer the data.

If you wanted to do it over 4 wires, and you wanted them to be momentary/hold switches, you should be able to do it with 2 PICs, one at each end.

First off, if you wanted them to be momentary, a simple press would work out quite well, but if you wanted them to be press on, then a double press would work. Although this would make it a little difficult to turn it on and off quickly, and would add a small amount of lag from the time when you pressed the button until it came on. It would solve the problem, plus would be relatively easy to program. ( I MIGHT be able to whip up some code that would work, tho it would be for a PICAXE, cuz that’s my chip of choice currently.) Plus why flip a dip switch when you can just press it 2x quickly. )

Second, if you wanted to send data over a 4 wire line, you could use a pulse system. Example: You want button one to come on constant. You have the thumb slider on S1, and you use button 1, pressing it quickly 2x. The PIC up front in that module would translate that data to be, Wire 1 high ( signifying S1 ) and 2 high pulses on leg 2. This would tell the rear PIC to activate relay 1 constant. Just have to make sure that your output of the front PIC’s programming fills the requirements of the rear PIC’s input side.

This pulsing would allow for great flexibility of information transfer. Though I know it isn’t a true serial connection, it would work for your purpose, and could make data transfer quite easy. Plus, the front PIC could control both the LEDs and record button presses so you don’t need bidirectional data transfers.

The rear PIC would just need some relays and the input lines and it would be all good to go, depending on your requirements of power of course.

Then again, this might be an antiquated way of sending data and I just don’t know it, but to me this seems a way that I would do it with my current knowledge Mostly cuz theshadow’s post has a lot of stuffs I know nothing about. I’m just workin with the chips that I know about, and I’m not an EE. Or any sorta E… just a lazy bum.

I do know that the PICAXE’s are relatively simple to program and use… since they are serial programmed and use the simple basic language. Plus.. they are cheap. For my mod I’m gonna get a 40 pin for the number of I/O’s I need, and it’s like.. $30 bucks. I don’t know how that compares to other Basic STAMP like PICS, but since the programming software is free, it’s the proper price for me. ;)

If I can be of any assistance, let me know.
 
SpazzeBlue said:
If you wanted to do it over 4 wires, and you wanted them to be momentary/hold switches, you should be able to do it with 2 PICs, one at each end.
if you had 2 PICs, you could do it over 1 wire. I think that fleetcom can make most of the stuff, so I was trying to keep the MCU overhead at a minimum. There is no reason to use 2 micros – its just overkill.

Remember, he is not going to change any of the switches (from “momentary” to “hold”) because he wants to keep the original control panel without hacking it up. Besides, you can do it with the existing switches.

SpazzeBlue said:
why flip a dip switch when you can just press it 2x quickly
Because some things never need to be momentary, and some things never need to be continuous. I doubt that he needs them all to be both


SpazzeBlue said:
If you wanted to send data over a 4 wire line, you could use a pulse system….Then again, this might be an antiquated way of sending data and I just don’t know it, but to me this seems a way that I would do it with my current knowledge
Well, yes. What I said:
theshadow27 said:
the other way would be a single 16F84 and one 8 bit shift register to feed the anode's for the LED array as well as the keypad matrix.
what that means, translated into something you can understand, is that there is one PIC for keyscaning and LED output. This PIC keeps track of what switches are momentary, and which are constant. It also decides how to flash/dim or fullbright the LEDs. When a button is pressed or released, this PIC tells the relay moudule what outputs to change.

To get this data to the relay box, I suggested a pair of serial-parallel shift registers. What this meens is there are 2 chips that have 1 input pin each, 1 shared clock pin, one shared latch pin, and a total of 16 outputs. When the MCU starts up, and every time the outputs need to change, the latch pin (normally high) goes to ground, and the first set (relays 8 and 16) of data gets put on the 2 data lines. The clock (normally low) is pulsed, and then the second set (relays 7 and 15) gets put on the data line, and the clock is pulsed again. This repeats a total of 8 times, and the shift registers now have the data for relays 1-8 and 9-16 stored internally. The clock is pulled low, and the latch line goes high. This signals the shift registers to enable the new data, representing how the outputs are suppose to look.
Code:
Example shift:
Relays[16] = {1,0,1,1,0,0,1,1,0,0,1,1,0,0,1,0};
D1-00.111.000.111.111.000.000.111.111.00
D2-00.000.000.111.111.000.000.111.000.00
C1-00.010.010.010.010.010.010.010.010.00
E1-10.000.000.000.000.000.000.000.000.01
The whole process takes less then 1/8 a second, meaning no noticeable delay

this is a primitive way of doing it, but it is necessary to allow one PIC to run the whole show.

If you were going to go all out and use 2 PICs, you could use the built in serial protocol (even PICAXE has them if they are compatible with P-BASIC) and use only a data and clock line. That’s 2, not 4. if you really wanted, you could use IC^2 and have bi-directional serial communication with 2 lines of code. Again, I realize this may seem easier, but it does require the programming of two PICs, and that is what we are trying to avoid

SpazzeBlue said:
While I do not know much about PIC’s myself, and I’m just workin with the chips that I know about, and I’m not an EE. Or any sorta E… just a lazy
apparently :rolleyes: if we were teaching a basic microcontroller course, we might use some of your ideas. There really isn’t much you can do with drastically overpriced Stamps, or moderately overpriced PICAXEs. C is the way to go, unless your writing a short program, where you can use ASM. Basic is slow, no matter what way you look at it, and therefore it cant scan 8x2 keys AND light up 8x2 LEDs at the same time, not without some help at least (i/o expander)


but nice try ;) it’s the thought that counts
 
ya i would be willing to put together all the pcb' and components minus anything that needs programming since i dont have the means to program them... also remember that the 4 or 6 pin phone cable also carries power to the control panel
 
Back
Top