1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

Merge pull request #12734 from maribu/atmega328p-doc

boards/atmega328p: Fixed doc
This commit is contained in:
Marian Buschsieweke 2019-11-18 08:20:35 +01:00 committed by GitHub
commit cd0b9755eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,19 +18,20 @@ any external components at a supply voltage anywhere between 2.7V and 5.5V.
@image html "https://github.com/maribu/images/raw/master/ATmega328p.jpg" "ATmega328p DIP package on a breadboard"<br> @image html "https://github.com/maribu/images/raw/master/ATmega328p.jpg" "ATmega328p DIP package on a breadboard"<br>
### MCU ### MCU
| MCU | ATmega328p | | MCU | ATmega328p |
|:------------- |:-------------------------------------- | |:------------- |:--------------------------------------------- |
| Family | AVR/ATmega | | Family | AVR/ATmega |
| Vendor | Microchip (previously Atmel) | | Vendor | Microchip (previously Atmel) |
| RAM | 2Kb | | RAM | 2KiB |
| Flash | 32Kb | | Flash | 32KiB |
| Frequency | 8MHz (up to 20MHz with external clock) | | EEPROM | 1KiB |
| Timers | 3 (2x 8bit, 1x 16bit) | | Frequency | 1MHz/8MHz (up to 20MHz with external clock) |
| ADCs | 6 analog input pins | | Timers | 3 (2x 8bit, 1x 16bit) |
| UARTs | 1 | | ADCs | 6 analog input pins |
| SPIs | 1 | | UARTs | 1 |
| I2Cs | 1 (called TWI) | | SPIs | 1 |
| Vcc | 2.7V - 5.5V (when clocked at 8MHz) | | I2Cs | 1 (called TWI) |
| Vcc | 2.7V - 5.5V (when clocked at 8MHz) |
| Datasheet | [Official datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) | | Datasheet | [Official datasheet](http://ww1.microchip.com/downloads/en/DeviceDoc/ATmega48A-PA-88A-PA-168A-PA-328-P-DS-DS40002061A.pdf) |
### Pinout ### Pinout
@ -44,18 +45,24 @@ All credit for above pinout image goes to https://github.com/MCUdude/MiniCore#pi
The ATmega328p has two internal oscillators clocked at 8MHz and at 128kHz that The ATmega328p has two internal oscillators clocked at 8MHz and at 128kHz that
allow it to be operated without any external clock source or crystal. By default allow it to be operated without any external clock source or crystal. By default
the fuses are configured to use the internal 8MHz oscillator resulting in a the fuses are configured to use the internal 8MHz oscillator and a clock divider
clock speed of 8MHz. By setting the `CKDIV8` fuse the clock divider can be resulting in a clock speed of 1MHz. By clearing the `CKDIV8` fuse the clock
enabled to operate the ATmega328p at 1MHz. divider can be disabled to operate the ATmega328p at 8MHz without an external
clock source. This can be done like this:
avrdude -c usbtiny -p m328p -B 32 -U lfuse:w:0xe2:m
(Replace `usbtiny` with the ISP programmer you are using. The `-B 32` might
be needed on some ISP programmers to communicate with slow ATmega MCUs. It will
not be needed anymore after the clock device has been disabled.)
This "board" is configured to use 8MHz as core clock, so that the ATmega328p This "board" is configured to use 8MHz as core clock, so that the ATmega328p
can be used without external circuitry and without any changes in the default runs at the highest frequency possible without external clock sources.
fuse configuration.
By setting the environment variable `ATMEGA328P_CLOCK` to a custom frequency in By setting the environment variable `ATMEGA328P_CLOCK` to a custom frequency in
Hz (e.g. `1000000` for 1MHz), this core clock can be changed easily. Refer to Hz (e.g. `1000000` for 1MHz), this core clock can be changed easily. Refer to
the datasheet on how to configure the ATmega328p to use an external crystal, the datasheet on how to configure the ATmega328p to use an external crystal,
an external clock source or the clockd divider. an external clock source or the clock divider.
### Relation Between Supply Voltage, Clock Frequency and Power Consumption ### Relation Between Supply Voltage, Clock Frequency and Power Consumption