Solved

Timing/Counting Circuit

Posted on 2006-07-11
23
826 Views
Last Modified: 2013-12-09
Hello all,

This may not be the correct forum for this question, but hopefully, if I can't get a specific answer, maybe I can get some pointers on where/how to look for this info.

Here's what I've currently got:  1 manual switch box with 70 switched circuits.  I use this to fire cues in personal fireworks displays.  While this definately works, I'd like to build a timing circuit that allows me to preset times for specific cues to fire.

I have the following timeline: Cue1-0:00, Cue2-0:53, Cue3-1:06, Cue4-1:23, etc.  The best I can figure with my limited knowledge is to use something like a CMOS4206 (or 2 or 3) and have those clocked from a 555 timer.  Then, I could use a sequence of AND gates to logically figure out when my Cue-times happen and trigger a relay to pass the charge along.  Unfortunately, this is very cludgy and would be hideous to redo the logic each time the Cue-times change, especially with a set of 70 cues.

So, what I'm looking for is either what chip(s) might be able to perform this function for me (maybe a programmable chip with a certain number of output triggers)?  Or a site with a simple project that encompasses this that I could use as a template.  They do sell professional items that will do this, but as I'm only a hobbyist, I can't justify shelling out a few grand for one of these boxes.

Thanks for any input!
chris.
0
Comment
Question by:cciesliga
  • 13
  • 7
  • 3
23 Comments
 
LVL 8

Expert Comment

by:markps_1
ID: 17080826
 Hi, if you don't want to use a micro processor to do this task a great choice is to use up counters instead of AND gates.. Use a 555 with a series of up counters in line... with a few combinations you'll be able to time on your cue... This is still a clumsy solution...


   The good solution is to use a micro processor to do the timing and  SERIAL in Parallel out to demultiplex your 70 trigger lines.

0
 
LVL 8

Expert Comment

by:markps_1
ID: 17080923
This is a great chip... http://www.allegromicro.com/sf/6276/    you can drive 16 lines per chip and can mount several those in series so you can drive all 70 switches using only two pins from a micro processor...

 if you have no experience with microchips simply buy a development kit I recommend ATMEL.COM
0
 
LVL 8

Expert Comment

by:markps_1
ID: 17080935
I mean if you have no experience with "micro processors"
0
 
LVL 1

Author Comment

by:cciesliga
ID: 17081207
markps_1,

Thanks for the ideas.  I don't have experience with micro processors at this point.  Sounds like this will be the direction I need to take though to get away from the clumsiness of the other solutions.  Is there a specific developer kit you would/can recommend?
0
 
LVL 8

Expert Comment

by:markps_1
ID: 17081532
 If you know how to program you know how to program a micro processor.. there is no mistery on it. And to turn pins on and off is Very simple to do on a micro processor.. it is like assigning a value to a variable.

    Since You'll not find  cheap solution for a micro processor with 70 I/O pins..   The solution to drive abunch of serial in/ parallel out  chips is the way to go..  you can go to the Allegro website and request free samples of the 6276 chips. And you'll be in business in no time.  I recommend downloading the datasheet of the 6276 and reading it over and over until you understand how to drive them.

   Choosing a micro processor for you is easy, speed is not an issue since you'll be using a very slow process control and the number of I/O pins is also not an issue since you'll be using only two. Also you don't need any feature like PWM of things of the kind.. I would say that any micro processor will do ;o)
  Then the main thing for you is what language you'll be programming.. If you know basic graba a basic stamp from Parallax (a bit pricy) If you know C I recommend an AN AVR development kit... You could buy the Butterfly Development kit from Atmel and the ICE programmer it will cost you around $40 for everything.

   Since you'll be using only two I/O pins... an interesting cheap choice is the new www.silabs.com/toolstick  you can remove the two LEDs from that demo board and solder two wires from there to your development board. The toolstick comes with two sample programs all written in C it is really easy to program.
0
 
LVL 8

Expert Comment

by:markps_1
ID: 17081607
I'm sorry I've said AVR ICE it should be the AVR ISP.  

 I do recommend begining with the AVR just because it is the most used 8 bit micro processor in the market.

  To buy the Atmel development kit go to digikey.com and search for "butterfly" it will go streight to it. The AVR Butterfly costs $19.99. You'll also need to buy the ATAVRISP2 (this is the programmer for the chip). It will cost $34

 Another AVR solution is the STK500 that's the full development kit from ATMEL it costs a bit more about $79.99 in the end it is a bout the same thing. The "butterfly" is very compact and you can embed it in your system with no guilty and it has a display and push buttons so you are ready to go.
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 17082567
If I were doing this, I would use a CPLD.  

For example, the Atmel ATF1508 has 128 flip-flops and upto 96 I/O pins.

              http://www.atmel.com/dyn/resources/prod_documents/doc0784.pdf

All you would need is the CPLD, a clock, and whatever driver chip you need to fire the ques.

1.   You would take a 1 MHz clock and divide it by 10,000 to make a 0.01 second time base.
      This would take 20 flipflops.

2.   Then you make a counter/sequencer that counts from 0 to 1000 ==>  0.00 to 10.00 seconds.
      That would take another 10 flipflops.

3.   Then you can program each output channel to fire at a particular count.

4.   You would program the counters and the firing list on a PC, and program the chip over a parallel port.

======================
The chip is around $5.  
The programming cable is about $50.  
The software is free.

You would need a custom PC board.  Probably $100 from ExpressPCB.

The biggest cost would probably be the connectors.
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 17082574
And by the way, this is certainly the correct forum.
0
 
LVL 8

Expert Comment

by:markps_1
ID: 17082795
D-Glitch,
   Using a CPLD is another alternative but I've put it asside right the way because of the following reasons.

     - If he is going to program using Verilog it will be extreamlly complex for a beginner
     - The logic of several flip flops in series to measure time could be confusing for a beginner.
     - Handling a massive pin count surface mount component is not practical for prototype.  All chips I've recomended are available in DIP packages. The best solution for him would be a turn-key development kit. How many Custom PCBs do you think he will need before his final design? A CPLD choice will be too expensive in the end.
     - He will have a very limmited room to customize different switching sequences. Every time he decides to switch on a different sequence he would have to re-program the CPLD or re-wire the switches on the field. With a micro processor he could store hundreds of sequences and times and everything could be customized on the field.
     - We don't know his power requirements. Using those serial in/parallel out drivers from Allegro he could choose a much higher current source/sink from their product list. Using a CPLD, If his power requirements are too high he would eventually need drivers CPLD I/O pins.
     
    Using a micro processor will give him much more room to grow his design. And since this is his first touch with embedded systems what a great excuse to learn how to work with a Micro processor.
0
 
LVL 8

Expert Comment

by:markps_1
ID: 17083001
 To prototype this you could use the "Grid-Style PC Board with 2200 Holes" part number 276-147 at RadioShack and the connectors could be the 276-1388 PCB terminals that are also available at your local radioshack.
0
 
LVL 27

Assisted Solution

by:d-glitch
d-glitch earned 200 total points
ID: 17083024
Valid points but:

  - I would recommend WinCUPL not Verilog.  They have sample code for counters.  
    Most of the program is just the firing list.  
    I would estimate 150 lines of code and two hours of work.

  - I agree about surface mount chips.  I use the ATF1508 in the 84-pin PLCC socket exclusively.
    I just checked and it only has 64 I/O pins.  So I would use two of them.

 - I would recommend getting one of the CPLD starter kits before going to a custom PC Board.
   But if you are reasonably careful, I would expect the first prototype to work fine.
   There one clock input, one trigger input, and 70 outputs.

  - If you need to change the firing order, all you have to do reprogram the list.  
    You do need a laptop if you want to make changes in the field.

 - I would certainly recommend line/peripheral drivers on the outputs no matter what the power
   requirements for firing the que are.  

 - I could post a skeleton WinCupl Program and a two CPLD PCB file if anyone is interested.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 8

Expert Comment

by:markps_1
ID: 17083221
 I don't want to got to a Ping-Pong kind of answer that I say some thing and you say something ;o) so this is my last point here.... :-)

  The key here is simplicity.. Since he will probably need drivers at the end of each I/O pin from the CPLD he could skip the CPLDs alltogether unsing a micro processor. And with the Serial IN/Parallel Out drivers this device could be scalable to hundreds of pins!  And even better he could begin his prototype with as simple as ONE chip driver and expand as he gests confortable with the design.

  After many years programming FPGAs things seem simple when you think about connecting CPLDs in series but can you imagine for a beginner how impossible that might look like? Any one can program a Basicstamp to spit out serial data. Remember this has to be simple.

 here are a few good points why to use the 6276 Allegro drivers

 - To 90 mA Constant-Current Outputs
 - DIP package available.
 - Free Samples availabe!

http://www.allegromicro.com/datafile/6276.pdf

0
 
LVL 8

Expert Comment

by:markps_1
ID: 17083256
another good point regarding the 6276 Allegro driver...

The DIP package A6276EA-T Allegro MicroSystems Costs only $1.80.  That's only $1.80 for 16 outputs!

This item can be found at http://www.arrownac.com
0
 
LVL 1

Author Comment

by:cciesliga
ID: 17084688
Thanks both of you for your inputs.  I'll check this out in more detail when I get off work tonight.

Additional details for what I'm needing at the field:
e-matches are fired with a 12v system at 2-3A.  I don't have an issue deisgning a low voltage system that will in turn fire the higher voltage cues via relay or something like that.  Unless I can pass the voltage current requirements through one of the aforementioned possible solutions.

As to programming, the timing of the cues would all be done "in-house" before the event.  So, once I get to the event, I connect the control box to the cues and press Go when I'm ready to kick it off.

I've got a year to play and learn what I need to learn.  I'll probably end up getting simple starter/learner kits to begin with so I can determine which method will work best for me and my knowledge level.

markps_1 - you've already provided the info I requested for a starter type kit I believe.
d-glitch - you mentioned WinCUPL and a chip/cable to use with that.  I've pulled the manual down and will look over it.

I've got limited programming experience.  But, if there are code samples provided that get me close, I should be able to go with that unless it's just not that simple.
0
 
LVL 8

Accepted Solution

by:
markps_1 earned 300 total points
ID: 17086540
  Hi cciesliga...

   Here is the link for the AVR studio.. You can begin playing with it    http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2725

   After reading your requirements you enforce my feelings regading not using a CPLD. Please, don't use WINCUPL. Don't use a CPLD as D-Glitch mentioned. Since this is a fireworks display. You need security measures to make sure when you power your device up it won't be at a random state or the clock won't be running before you are ready...

    The only safe way to do that is to use a micro controller that at boot time it will clear all the bits. This micro controller could be also attached with a keypad. Then you program a requirement on your software that it will only run the sequence if you punch a passcode on your keypad. This way if you even accidently press the push buttons or the re-set button, your fire works won't fire untill you've pressed the correct code.
   
0
 
LVL 1

Author Comment

by:cciesliga
ID: 17087755
Thank you both again!  

It looks like with my current knowledge level I'm going to have to start a little smaller and work my way up.  I'm going to go through all the info and simulators and begin playing.  I'm sure I'll be back as additional questions come up.  I've added a few more points and hopefully the split is agreeable.
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 17091086
>> markps_1

After this post yesterday:

      I don't want to got to a Ping-Pong kind of answer that I say some thing and you say something ;o) so this is my last point here.... :-)

I was surprised to find this post today:

     Please, don't use WINCUPL. Don't use a CPLD as D-Glitch mentioned ....
     The only safe way to do that is to use a micro controller ...

PERSONALLY OFFENSIVE.  Although the pleading is a nice touch.

FACTUALLY INCORRECT.  How did they set off fireworks before the micro controller was invented?

UNFAIR to say the least.  Saying "Let's not do this."  Claiming the last word, and then coming back for one last blast.

UNPROFESSIONAL as well.  Why don't you just make your best case and let me make mine?
=======================================================================

>> cciesliga

I have a BSEE and 30+ years of hands-on-the-hardware experience with high power DOE projects.
I certainly take safety and reliability very seriously.

Back in the 70's I designed a firing circuit for an exploding fuse:  20 kA interruption, 10 us response, blasting caps, det cord, able to leap over tall buildings, blah blah blah.  I didn't use a CPLD because they hadn't been invented yet.  But there's no inherent safety problem with CPLD's.  I would be perfectly willing to use one in a similar application today.

You can build a safe, reliable fireworks controller with a mechanical clock and a punched tape.  You can use gates and relays.  You can certainly use CPLD's.  And you could even use micro controllers.

Safety isn't in the components, it's in how they are used, the overall system design, and the development and adherence to formal procedures.

For example, the idea of password protection on the control box seems a little silly.  I think you would get more effective protection by putting shorting plugs on the que firing lines, and maybe a key switch on the 12 volt battery.
======================================================================

I have the WinCUPL code for a 36-output Sequencer.  I have to modify it slightly so that it has time resolution of seconds rather than microseconds.  I will test it and post a link before the end of the week.

That will be my final post.  And I really mean it.

Looking forward to your future questions.
0
 
LVL 8

Expert Comment

by:markps_1
ID: 17091495
Wow, take it easy this is a friendly forrum. I've made my case... life goes on..

     
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 17107860
I have a 36-Channel CPLD Sequencer up and running on my desk.
It is manually triggered, with a maximum window of 1023 seconds, and a timing resolution of 1.000 second.
It can fire 36 LED's in any arbitrary sequence.  

You can also get an Atmel ATF15xx-DK2 Development Kit from Digi-Key for less than $100.
This kit includes the software (which you can download for free) and the programming cable,
The board has all 60 of the available I/O lines connected to LED's.

My program should run on the DK2.  You would need to check the pin numbers for the START and STOP switches.
No other mods should be necessary.

Here are the relevant links:

          http://www.geocities.com/d_glitch/FW_TIMER.txt
          http://www.atmel.com/dyn/resources/prod_documents/doc3289.pdf
0
 
LVL 27

Expert Comment

by:d-glitch
ID: 17107886
You have to change the file name from     FW_TIMER.txt  ==>  FW_TIMER.pld   to use it.

And the uploading seems to have messed up the TAB alignment.

0
 
LVL 8

Expert Comment

by:markps_1
ID: 17107972
 If the idea of using a CPLD instead of a real Micro Processor is in any way apealing, why not to use Xilinx instead?  Xilinx is the leading brand on CPLDs simply because they have the best prodcuts and the best free development software in the market.

  The XC9572 costs $3 and it has 69 I/O pins on a PLCC package. You can program using the ISE's graphic interface NO programming necessary. Any JTAG interface connect the XC9572 to your comptuer.

here is the device.
http://www.xilinx.com/products/silicon_solutions/cplds/xc9500_series/xc9500/index.htm

and the free developlment software is here.
http://www.xilinx.com/ise/logic_design_prod/webpack.htm

0
 
LVL 27

Expert Comment

by:d-glitch
ID: 17108112
>>  I don't want to got to a Ping-Pong kind of answer that I say some thing and you say something ;o(
      so this is my last point here.... :-(


>>   cciesliga

       If you ever want my thoughts on "Graphical Programming Interfaces"  just ask.


0
 
LVL 8

Expert Comment

by:markps_1
ID: 17108164
let it go.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Introduction: When a connection to the internet is established, there always exists a modem between the connected device and the ISP (Internet Service Provider). The Operating System (OS) on your PC controls the modem which communicates with the …
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now