The ATmega328P is a low-power, 8-bit CMOS microcontroller based on the AVR enhanced RISC architecture. Manufactured by Atmel (now part of Microchip Technology), it is well-known for its role as the heart of the Arduino Uno and other Arduino variants. This microcontroller is suitable for a wide range of applications, from simple hobbyist projects to sophisticated industrial controllers due to its versatility, reliability, and ease of use.
Pin Number | Name | Function |
---|---|---|
1 | PC6 | Reset |
2-3 | PD0-PD1 | Serial (RX/TX) |
4-5 | PD2-PD3 | External Interrupts (INT0/INT1) |
6-11 | PD4-PD7, PB0-PB1 | Digital I/O Pins |
12-19 | PB2-PB5, PC0-PC5 | Digital I/O Pins, Analog Inputs |
20-22 | AVCC, GND, AREF | Power Supply and Reference Voltage |
23-28 | PC1-PC6 | Analog Inputs, I2C (SDA/SCL) |
29-32 | PD6-PD7, PB0-PB1 | Digital I/O Pins, PWM |
- | AGND, VCC | Ground, Power Supply |
// Blink an LED connected to pin 13 on an Arduino Uno
void setup() {
pinMode(13, OUTPUT); // Set digital pin 13 as an output
}
void loop() {
digitalWrite(13, HIGH); // Turn the LED on
delay(1000); // Wait for a second
digitalWrite(13, LOW); // Turn the LED off
delay(1000); // Wait for a second
}
Note: The above code is a simple example to demonstrate the usage of the ATmega328P on an Arduino Uno. The actual implementation may vary based on the application requirements.
For more advanced usage and detailed programming information, refer to the ATmega328P datasheet and the Arduino language reference.