A programmable pulse generator

Discussion in 'Embedded Systems and Microcontrollers' started by Sparky49, Dec 18, 2012.

  1. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    Hi everyone.

    I've been working my way through the TI launchpad wiki, for the MSP430.

    However, I can't seem to find anything with using a keypad.

    Ideally, I'd like to build a programmable pulse generator.

    You start by entering the pulse amplitude, then the pulse duration, then the time between pulses. But I think that's a little bit off. :)

    I was wondering if anyone had anything which might be useful for programming with a keypad?

    I already have one, but I don't know much about it.

    It has 12 buttons (0-9, with * and #). Then there are 7 pins on the back,
    I am guessing it is a matrix keypad.:)

    Thanks very much much for your time guys!

    I'm programming (of sorts!) in C.

    Many thanks for your time.

    Sparky
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,136
    1,786
    Sounds like four rows and three columns, or three rows and four coulmns. Do you know how matrix keypads are supposed to work from the uP's point of view?

    You drive one of the four row outputs low and you see if the low shows up on one of the three column inputs. Then you move onto the next row. Wash, rinse repeat forever.
     
  3. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    Thanks. :)

    May I also ask how one would go about creating the pulse generator?

    I've created this flowchart to help describe my thoughts.

    [​IMG]
    Obviously there are a few dodgy aspects to this. The "combine to make pulse" is a good example.:D

    What sort of things will I need to use?

    Many thanks again, you guys are great.

    Sparky
     
  4. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    I've done some more thinking.

    I should be able to create the pulse (duration and frequency) on the uC itself, correct? However, there is no way I'll be able to source 10V (max) from the uC, it has a limit of 3.5V.

    So, I thought of connecting it to a PWM supply as shown. This supply is shown below.

    [​IMG]

    I will then combine the output from this (9V), with the signal pulse of 1V amplitude, with an adder. However, this will come out to -10V, so I will use an inverter to make it 10V.

    [​IMG]

    What do you guys think? This PWM will only be on when the signal pulse is on.

    However, I am worried about the rise and fall times. Ideally, I'd like the pulse to be between 10ns to 5us.

    Many thanks for your time.

    Sparky
     
  5. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Seems over complex to me. Why not just use your amp in X10 configuration?
     
    Sparky49 likes this.
  6. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    Thanks for the reply!

    The reason is I want to digitally enter the amplitude with a keypad. I don't want a pot to control the gain of the op amp.

    Saying that... Would it work if I replaced the 12V battery will the signal pulse?

    Many thanks,

    Sparky
     
  7. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    There are such things as digital pots. Never used 'em, but worth a look. If you use them, consider using them in a voltage divider and feed that into a fixed gain block.
     
    Sparky49 likes this.
  8. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    Thanks! Will check those out. :)
     
  9. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    I'm not too sure wether they'll be able to handle the currents?
     
  10. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Use them as inputs to your gain block. Currents will be minimal. Never use a voltage determining resistor to drive a load. Always use a buffer ( op-amp, gate, transistor, etc. )
     
  11. Sparky49

    Thread Starter Active Member

    Jul 16, 2011
    834
    417
    Okay, I've run into another (possible) problem.

    The pulse duration should be roughly between 10ns and 5us.

    That is fast.

    Is there any uC which is up to the task? Or should I make something which is controlled by a uC instead?

    I want the pulse to be repeated, so thinking about it, it is just PWM, but I don't think makes the problem any easier. :(

    What do you chaps suggest?
     
Loading...