Is this right for me ??

sketchy

New Member
Hi Everyone
I am a total noob to electonics and am still strugaling with some of the termanology you guys use. I have tried to read the picaxe manuals to see if a picaxe chip will do what i want before i buy one of your sets but i am still non the wiser so any help or advice will be much appreciated.

I want a chip that on a momantary pulse from a micro switch will turn 1 of the chip out puts on and then on a second touch will turn it off.

Then a momantary pulse from a micro switch to another input starts a sequence of outputs across 9 output pins that will continue until the same input pin recives another pulse

Then if a third input is high the previously mentioned 9 output pins all go high overiding the sequence.

Then a forth and fith input pin that on a momantary pulse from a micro switch will turn on yet another of the chip outputs and make it flash and then on a second touch will turn it off.

Does this sound possible. and how complicated would the code be to make it happen. I have had a play about with the flow chart software but not had much luck yet. Am i being over ambisious?

Any help much appreciated

Thanks.

Joe.
 

BeanieBots

Moderator
Sounds like a simple enough thing to do with a PICAXE.
You will need to get a chip with the correct number of inputs and outputs.

Assuming these inputs are push buttons that can be pressed by a human, you will also need to think about what will happen if buttons are pushed in the wrong order and/or pushed in the middle of one of the sequences.

If you can clearly explain exactly what needs to happen and when, then you almost written the program. It's getting the explantion clear that will actually be the hardest part.
 

jc173

Member
Joe,


I think you might want to draw out a "flow diagram" to show the basic arcutecture of the programme you want to do, look at the chips and their capabilites and then turn it to the basic syntax OR use the flow option in the progamming editor.....

The flow diagram will just put in black and white EXACTLY what you want to do.


Hope this helps,


James
 

westaust55

Moderator
That's 5 inputs and 11 outputs required.

Very do-able, but you will need either say a 28X1 , 40X1 or
a smaller PICAXE with
- 1 or 2 74HC595 shift registers, or
- an i2c IO expander to get more IO.
 

BeanieBots

Moderator
Given the electronics "newbie" status, I'd strongly suggest the 28X1 route.
Expanders will just add to the confusion. Also, easier to support from here if there is less hardware. No need to keep posting diagrams etc.

Something to think about.

"I want a chip that on a momantary pulse from a micro switch will turn 1 of the chip out puts on and then on a second touch will turn it off."

"Then a momantary pulse from a micro switch to another input starts a sequence of outputs across 9 output pins that will continue until the same input pin recives another pulse"

What should happen if the second button is pushed while the first output is high. These are all the things you need to clearly explain (to yourself if not us.)
 

sketchy

New Member
Wow thanks for your quick replys.

If i explain what i am using it for it may be clearer.

I want to use it for a set of lights on my push bike. I was going to use some micro switches out of an old telephone handset that i can mount in the grips.

The first button is to turn on the front light

The second button is to turn on the rear 9 leds that flash like knight rider

The third button is to over rule the flashing rear leds and make them all come on like a brake light

And the last 2 are for letf and right indicators.

You think i should get a 28x chip but it said in the manual that the 28x1 has 0-12 inputs 9-17 outputs 0-4 ADC 20MHz but this is not what it shows on the picture of the pin functions. I need 5 inputs and 12 outputs.

Thanks

Joe
 

Andrew Cowan

Senior Member
You think i should get a 28x chip but it said in the manual that the 28x1 has 0-12 inputs 9-17 outputs 0-4 ADC 20MHz but this is not what it shows on the picture of the pin functions. I need 5 inputs and 12 outputs.
Joe - this is beacuse many of the pins can be reasigned.

12 inputs plus
17 outputs plus
3 analogue inputs
Equals 33 pins.

They can't all happen at the same time. The pinout you are looking at just shows the defult arrangement.

Andrew
 

eclectic

Moderator
Another possibility, that might be easier to program.

Use TWO Picaxe 20M + AXE118 boards.


One 20M for the rear lights (eight LED's).
One switch for the flash sequence.
One switch interrupts for “brake”

Second 20M c/w three switches
1.Switches on an array of high power white LED's (via ULN2803)
2/3 for the amber indicators.

I think that the really critical part of this project
is making sure that everything is
thoroughly tested and weatherproof.


e
 
Last edited:

Wrenow

Senior Member
My first, and most obvious suggestion. Segregate the front light system from the rear array. All you need is on/off there - no chip at all. Then the rear array can be packaged together (under the seat?) with less wires to run to the front of the bike.

The 28X1 will do the trick, but you would also probably need a transistor to run the headlights (assuming a high draw light) - another reason for segregation.

Once you get it done, and want to waterproof, I strongly suggest 3M Brand Scotchkote. Looks nasty, but works great. We use it a lot in R/C Model Warship Combat to waterproof our electronics (our ships are sunk pretty regularly). Tooldip or liguid electrical tape tend to delaminate and let water in and trap it in.

Cheers,

Wreno
 

hippy

Ex-Staff (retired)
You think i should get a 28x chip but it said in the manual that the 28x1 has 0-12 inputs 9-17 outputs 0-4 ADC 20MHz but this is not what it shows on the picture of the pin functions. I need 5 inputs and 12 outputs.
As Andrew notes, some of the PICAXE chips have fixed inputs and outputs, some have inputs and/or outputs whose use is defaulted at power-up but can be changed by your running program.

Similar to what eclectic suggests, the 14M nominally has 5 inputs and 5 outputs but can AFAIR be reconfigured to have just 2 inputs and 9 outputs. If you took two 14M's you could have 5 inputs and 5 outputs on one, with an output connected to the second controlling 9 outputs; 5 inputs, 14 outputs in total.

That would be handy because you could have the main 14M doing most things, the second just driving your Knight Rider style display of 9 LED's.

Splitting a project up this way may sound complicated and extra effort but it can actually make things easier to design, implement, code and debug.
 
Last edited:
Top