Help! Simple Project Need Basic Code

Discussion in 'Programmer's Corner' started by DAK, Nov 3, 2010.

  1. DAK

    Thread Starter New Member

    Nov 25, 2009
    I recently built a circuit that would count a predetermined amount of pulses then send a high to an alarm. It is used on a pitching machine. It counts the amount of balls (each time the arm hits a limit switch) and activates the alarm after 8 pitches. Below hopefully gives you an idea of how it is currently set up.
    1. Pulse from Limit Switch
    2. Into 555 Timer to debounce the signal
    3. Then into a 4017 Counter/Divider
    4. After 8 pulses or high signals the corresponding pin would go high
    5. Then into 555 timer (used for the on time of alarm)
    6. Then into a Transistor which allowed power to the Alarm signaling the next batter to step in.
    7. A Reset Switch was place by the batter if for some reason he had to start over.
    8. Also the on/off switch to the pitching machine controlled power to the circuit. This would also reset the counter / divider in the event that the machine was turned off.
    Because of my limited experience, all of this took me forever to put together a board that would actually work with limited smoke J . I need another circuit for another pitching machine, but don’t want to go through all of this again. I also would like to get my feet wet and look into the possibility of using a microcontroller.
    Now the question is, with my limited knowledge of programming what would it take as far as code to do this using the PICF683? I’m using it because I’ve already have the PICAXE hardware and programming system which runs on Basic. I have written a few lines of code to turn on LED’s and some other things, but need help writing something that would work in place of some of the components and to operate the above project. Even pieces of code would help at this point.
    1 = V+
    2 = Serial In
    3 = ADC4/ Out 4/ In 4
    4 = Infrain /In 3
    5 = In 2 / Out 2 /ADC 2 / pwm 2 / tune
    6 = In 1 / Out 1/ ADC 1
    7 = Out 0 /Serial Out / Infraout
    8 = 0V
    Thank You for Your Time
  2. beenthere

    Retired Moderator

    Apr 20, 2004
    Better than an idea of the external circuitry would be a complete schematic pluse specs on all the components.