ATMega328p code for project & questions :)

Discussion in 'Embedded Systems and Microcontrollers' started by LeRadelle, Mar 29, 2015.

  1. LeRadelle

    Thread Starter New Member

    Sep 9, 2014
    Hello people;

    Im relatively new to this forum and programming AVR, not a total dummy but i need some help.
    So, the project is running the led bulbs via AVR to buck converters and finally LEDS.
    Ill put a diagram schematic so you can visualize how it looks.So im having problems with programming the AVR not how to program the chip,jet i have problem with code :/.
    I know its stupid to ask someone for a code but i have no choice then ask for help.
    What code needs to be doing.
    PSU on -> powers the ATMega328->checks the if PIN D.2 is 1 ->if so gives power to relay that powers buck converters-> 14 pins on atmega328p turns on and off the pins to turn the bucks on and off which turn LEDS.

    So now i have question about interrupts i want to be able to stop the code and turn it off or on(relay and everything off or on)if one of interrupts is triggered and if other interrupt is triggered i want it to change the way it blinks and if i press it again to change again so several codes will be needed to run the lights.I need someone to help me with that im writing code in atmel studio 6. Please help and thank you very much...any questions or any details please ask ill do my best to answer and clarify.

    Here is the pic if you can see any thing :/
  2. MrChips


    Oct 2, 2009
    All doable. Do you have some preliminary code that you can post for us to have a look?

    The first thing you want to do write some simple code to turn on/off an LED.

    Next step is to write code which will debounce a press of a push-button.
  3. LeRadelle

    Thread Starter New Member

    Sep 9, 2014
    No i haven't done any code regarding the requested...i have done some codes of random led switching its working fine...but i need code for interrupts and debounce(even i think it will not be needed because the signal on interrupts will bi driven by relay that will just ground the pin and the logical state 1 should be activated via internal pull up resistor...i written so much done so little :/