Hey guys, i'm using an Atmega328PU with Arduino Bootloader. I have tried to connect as shown in the following figure but it is not producing any output at all. I will be requiring the use of PWM pins for motor driver control and be using i2c interface with other two Atmega328PU. I have no clue or whatsoever since i've already removed and plugged in my Arduino Atmega chip onto the PCB after uploading a simple blinking sketch. Is my connection right since i will be using Analogwrite?
Your schematics show a header labelled RGB connected to PC0-PC2.
I can't see any correlation between this and your story.
The ADC next to the port number, tells you that these can also be used to sample analogue values (Analogue Digital Converter), that's an input, not an analog output (which do not exist on these chips).
They aren't PWM (which approximates an analogue output, but is in fact still a digital output).
You are also telling about I2C, but these pins don't seem to be used in your schematics.
Have a look at the pinmapping page, and find out what pins are used for what functions on an Uno.
Reading datasheets will also help you understand components.
You must include decoupling capacitors, 0.1uf from Vcc and AVcc pin to ground, as close to the pin as possible. These are not optional, without them all sorts of bad behavior is possible, from seemingly random resets to failures to upload - unfortunately there are a disturbing number of guides online that nonetheless omit this essential component.
You have provided no information on how it is misbehaving. How exactly have you connected it, and what steps have you taken, and at what point are you having problems? Have you bootloaded it? Was that successful?
Peter_n - the Atmega328-PU is compatible with Arduino, you just need a new boards.txt definition for it.
Hey guys, i'm sorry i did not explain much about the earlier post. I am currently using an Atmega328 chip from an Arduino Uno to signal my Slave #1 device for my display unit which is used to control the RGB and a 16x2 LCD using shift register. I am having issues with the processing unit(all three Atmega328PU) not having to output expected results. Therefore i did a short debug and research realising that i had to connect 100nf decoupling capacitor to ground as close from Avcc and Gnd(so i did).
The only connection which i'm yet to make is to remove Aref connection from Vcc to Gnd instead through a 100nF Capacitor. As of now, the red RGB(pin 23 /PC0/ADC0) lights up if i connect the Atmega chip regardless of my change in LED colour by programming the chip(plug into UNO to program and Remove). If i were to remove the Atmega chip, the Red RGB does not light up at all.
How is the RGB led connected ? which RGB led is it ? One of those 5050 RGB leds ? There are three main types of 5050 RGB leds (without chip, Neopixel, and the one with data and clock).
Please use the '-'. The name is "ATmega328" (or ATmega328-PU) or "ATmega328P" (or ATmega328P-PU).
Could you make a photo of it ? If you have made this on a breadboard, perhaps the breadboard has a bad contact, or the wires to the crystal are too long.
The LED is not connected to PWM pins and the LCD is not connected to the I2C bus.
Thanks
The length from the ATmega328P to the crystal (or resonator) and the length to the 22pF have a very big influence. If they are 10cm or so, the ATmega328P could go nuts.
You need resistors for each R, G and B pin.
Without those resistors anything can happen (bad things ).
Do you use analogWrite() in your sketch for the RGB led ?
The analogWrite() is not analog, it is PWM. You need pins that are capable of PWM.
I suggest to make the sketch work with an Arduino Uno, and then try to do the same thing with the bare ATmega328P.
Slow down please. You are running into trouble. Let's do this step by step.
A capacitor of 100nF to AREF and GND, and nothing else to AREF. I think you have that.
VCC to 5V and also AVCC to 5V. Do you have that ? They both should supply 5V power to the chip.
A decoupling capacitor of 100nF to VCC and GND, preferably another one at AVCC and GND.
The AnalogWrite has nothing to do with analog, and the PWM signal changes the duty cycle, not the frequency.
Use the pinmapping as we wrote : https://www.arduino.cc/en/Hacking/PinMapping168
The "(PWM)" pins can be used with the analogWrite() function.
You can also use the reference of the Uno : https://www.arduino.cc/en/Main/ArduinoBoardUno
"PWM: 3, 5, 6, 9, 10, and 11"
You have to tell us or show us how you have connected everything. When you for example use that RGB led without resistors, then nothing might work. We might keep on telling what to do, but if we don't know how you have wired it and what your sketch is, then this could keep on going without solving the problems.
It works on digital pin if i were to write digitalwrite, but it doesnt work when i digitalwrite on Analog pins using the Atmega328P-PU from Arduino Uno R3.
I have also bought 2 more Atmega328P-PU with optibot UNO bootloaded, but i'm get "avrdude" error sigh):