Hi, I'm having a bit of trouble understanding how to power the Atmega328P chip on it's own (without Arduino Uno).
I am using a 12V (not well regulated ~15-12V) power supply. I need the Atmega328P to detect input from a dip switch and do pwm on a 3W rgb led (via transistor). I am using 3x BT337 in parallel as current regulator for each color of the led. If I connect 12V to vcc/gnd will it power the Atmega328P and output 5V from some of the pins? If i disconnect the 12V source the code stop executing. I measured the voltage between Vin/gnd and it was 6.3V maybe this is causing the problem (should be over 7V), voltage between 5V/gnd is 3.5V? Can someone explain in detail how I would go about powering the device?
Absolute maximum supply voltage for the ATmega328 is 6.0V, normally you won't see more than a 5.0V supply. Regulated voltage is also strongly preferred. Suggest using a simple 5V regulator like a 7805 to supply Vcc for the microcontroller. The MCU can still drive transistors or other external circuitry that in turn controls higher voltages, but the voltage on any pin of the MCU should never exceed Vcc + 0.5V or be less than -0.5V.
Thanks for the answer. Do you mean 5V or 0.5? If you did mean 0.5V, is this why you see 10k resistors used with switches?
Thanks for the answer. Do you mean 5V or 0.5? If you did mean 0.5V
The voltage on any pin should never be more than (Vcc + 0.5V)
...means the voltage on any pin should never be greater than half a volt more than the supply voltage (Vcc).
The voltage on any pin should never be less than -0.5V means not less than half a volt below ground potential. This might occur with AC signals (which alternate above and below ground potential) or if dual-polarity supplies were involved.
is this why you see 10k resistors used with switches?
Hard to say what a 10K resistor might be for, without seeing a schematic. Strong possibility it is a pull-up or a pull-down resistor. OTOH, the m328 has built-in pullup resistors that can be used.