Connect with us

Code needed for PIC16F684 to control LED's

Discussion in 'Microcontrollers, Programming and IoT' started by WHYnot, May 9, 2016.

Scroll to continue with content
  1. WHYnot


    Apr 19, 2016
    I am trying to put together a circuit that has 3 buttons for control.

    Button 1: Power on/Select output
    Button 2: Enable output
    Button 3: Power off

    Each output needs to oscillate the same bank of LEDs but at 5 different preset frequencies (frequency chosen with select button).

    It is a battery powered circuit with a DC plug to be charged by a 7.2V 750mA DC adapter
    Low battery and charging indicator LED
    Overcharging protection
    Batteries are 3.6V 600mAH NiMH

    I am looking for someone to assist me in my project by writing a bit of code for the PIC16F684.
    I do plan to learn how to write programs in the not to distant future however this project has a deadline and I won't have enough time to get into this before then.

    If there is anyone who would be willing to assist me please let me know.

    Thanks in advance
  2. Minder


    Apr 24, 2015
    Look at Nigel Goodwins tutorials .
  3. Herschel Peeler

    Herschel Peeler

    Feb 21, 2016
  4. Herschel Peeler

    Herschel Peeler

    Feb 21, 2016
    Before anyone can help we need specifics of the overall operation. LEDs blink at any specific frequencies?
    chopnhack likes this.
  5. chopnhack


    Apr 28, 2014
    More than just that - @WHYnot - will you be able to post a schematic? Will this be a simple, scroll by hitting the button again situation? What is the purpose of selecting the output and then a separate button to enable it?
    This seems to be for a piece of decorative art. I would assume that there is a always on, random pattern, and then various time delay or fading. Good choice on chip, plenty of memory and its a low power series. Since its a battery operated device that will need to be recharged you may also want to learn to how to put the pic to sleep so that it consumes next to no power while waiting for it to be activated.
  6. Herschel Peeler

    Herschel Peeler

    Feb 21, 2016
    So we have three switches, pushbutton?
    We have one output that drivers 5 LEDs? what kind. What does the blinking indicate?
    We have an analog input to monitor battery voltage?
    We have an LED output to indicate that the battery is charging?
    We have an LED to indicate the charging is complete?
    We have an output that controls the charging of the battery?

    Anything else?

    The PIC16F684 has 12 I/O lines, each with multiple purposes. Eight can be analog inputs.
    We have uses for eight so far. That allows one for Reset. Two can be used for an oscillator, or we can use the internal oscillator.
    One can be V REF for the analog section.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day