Block Diagram for the Internal Resources of ATmega328P MCU

Please, put your comments for further improvement/correction of Fig-1A. The diagram is prepared to present to the 3rd year level undergraduate students of Electrical Engineering in their Microcontroller Interfacing and System Design course.


Figure-1A:
Latest/Edited Block Diagram based on the comments of posters:

Figure-1B

(1) M10 (Module-10): The ATmega328P MCU of the Arduino UNO Board runs at 16 MHz clock frequency. If desired, it can be operated by an 8 MHz internal oscillator (M11). Using internal Clock Prescaler Divider (not shown in Fig-1), the MCU can be run at 31250 Hz to 16 MHz.

(2) M7 – M8: The internal electronics world of the MCU are divided into Digital Electronics and Analog Electronics These modules have their own power supply (DAVcc and AVcc which are externally shorted (as shown in Fig-1) in the Arduino UNO Board. Two GND pins are internally shorted by the MCU chip.

(3) M9: When power switch is turned on, 5 V arrives at Vcc pin. Voltage at RESET/-pin (voltage across C1, VC1) begins to rise. The MCU remains at RESET state until VC1 crosses 1.7 V (VPOT, Power-on Reset Threshold Voltage).

(4) M16E: PORTB consists of six 1-bit data latch named as PB0 – PB5. They are connected with six IO (Input or Output) lines. IO lines are used to connect input device (switch) and output device (LED). Direction of an IO line can be input or output. An IO line originates from a physical pin of the MCU and terminates at the hole (Fig-1) of the edge connector of UNO Board. The holes are named as DPin-0 to DPin-8; DPin-A0/14 to DPin-A5/19. (DPin stands for Digital Pin.)

The direction of an IO line is set as INPUT or OUTPUT by executing the following functions:

pinMode(DPin, direction); //DPin = 0–13, A0/14–A5/19; direction = INPUT, INPUT_PULLUP, OUTPUT

pinMode(8, INPUT); //DPin-8 will work as input line with external pull-up or pull-down resistor.

pinMode(8, INPUT_PULLUP); //DPin-8 will work as input line with internal pull-up resistor, Rip (Fig-1.9)

pinMode(8, OUTPUT); //now, DPin-8 will work as output line

A HIGH (5 V) or LOW (0 V) can be written on a DPin by executing the following functions:

digitalWrite(DPin, value); //value = HIGH (5 V) or LOW (0 V)

digitalWrite(8, HIGH); //HIGH means 5 V is asserted on DPin-8

digitalWrite(8, LOW); //LOW means 0V is asserted/written on DPin-8

1-bit data (HIGH or LOW) from an input line can be read by executing the following functions:

bool y = digitalRead(DPin); //y holds logic value of DPin line

bool y = digitalRead(8); //

(5) M1: 8-bit AVR (Advanced Virtual RISC Microprocessor; where, RISC stands for Reduced Instruction Set Computer and Microprocessor is abbreviated as MPU. It takes command/data from user via keyboard, modifies data in a way user wants, sends result to user via display unit.

(6) M2: It is an 8-Bit Arithmetic and Logic Unit. It can add two 8-bit data at a time. If there is a carry bit due to addition, then the carry bit is saved in the Carry Flag (C) of the ALU Unit.

(7) M4: This is non-volatile Flash Memory (also known as Code Memory or Program Memory). A non-volatile memory does not loose code/data when power supply is disconnected. It holds the binary codes of the application program. The capacity is 32 Kbytes (32x1024 bytes).

(8) M5: This is non-volatile EEPROM (also called Data Memory) memory and holds critical data like password, bank balance etc. EEPROM stands for “Electrically Erasable Electrically Programmable Random Access Read Only Memory”. The size is 1 Kbytes (1024 bytes).

(9) M6: It is volatile RAM Memory and is used for the temporary storage of variables. RAM stands for “Random Access Read and Write Memory”. The size is 2 Kbytes.

What are those 'M' numbers

M for Module.

Handy reference from the ATmega328p data sheet:

Your diagram is from the official data sheets which apparently shows that PORT D and USART 0 are seperate modules; in fact, USART 0 is the alternate function of PD0/PD1 pins of PORT D.

In Fig-1 of #1, it has been clearly indicated that UART is the alternate function of PORT D.

Diagram of #4 is of Engineering Level; whereas, diagram of #1 is of Learning Level.

It is my opinion based on class experinece that the students find difficulties to read diagram of #4.

When Fig-1 of #1 is studied against the following diagram (Fig-2), the students can easily find which pins/signals of the MCU serve which alternate functions. For example: PD0(RXD) and PD1(TXD) deliver alternate function as UART.


Figure-2:

Your confusion about the nature of functional modules in the processor does not benefit your students.

I appreciate your comment and would be happy to receive your guidance as to how bring necessary change when: MCU = MPU + IO Controller + Memory.

In a MPU like 8085 what we see are:
ALU
Reister Set
Sequence Generator
(Address lines)
(Data lines)
(Read, Write, Memory and IO Selction Control lines)
(Few other supportive modules like: oscillator, etc.)

I'm not sure what your comment means. The USART0 module is a separate, independent logic block, diagrammed below, that takes over control of pins 0 and 1 of PORTD, if enabled.

As you know, there can be several USART modules (four in the ATmega2560).

  • Perhaps, make C1 .1 thru 1uF. 10uF is really large.
    Add diode across R1 for C1 discharge path.

  • “Hole of edge connector…” >>>———-> header pin.

  • Add de-coupling capacitors to Vcc pins.

These GND connections are a little confusing.
Souuld there be external lines there or not?

Based on my 15 years experience of studying hundreds of complex schematics of Schlumberger Well Logging Tools for the purpose of troubleshooting, I have learnt that all lines bearing identical symbolic names are tied togeter.

In Fig-1, all lines labelled GND are tied together and are terminated at PPin-8, 22 of the ATmega328P MCU. So, giving PPin-22 (physical pin) or PPin-8 at the GND signal of M8/M9 would make MCU's pin count > 28.


Figure-1:

This is a block diagram for learning purposes and not a schematic. This is the reason for which I have not added the required design features like decoupling capacitor with Vcc line, AREF line, load capacitors for the crystal, and etc.

I do care your comment on the RESET/ circuit for which I am exploring offcial schematic of Arduino UNO. Once I found the schematic, I will correct the Reset/ circuit.

The edge connector has (actually) holes into which we insert male-pins of the jumper wires.

  • Yes, I understand this isn’t meant to be a schematic, however, de-coupling is so commonly missed and is so important suggest you add two capacitors (even without values) IMO.
    If nothing else, it stirs discussion in the student’s head. :thinking:

  • At power off C1 discharges thru the diode. Another discussion element for the student.

  • I like your efforts . . .

The following Reset/ circuit (Fig-1 found in net) follows your recommendation in #9. D9 helps to limit the transient voltage (due to On/Off of SW1) to 5.7V and thus saves the reset-circuit of te MCU. C10 discharges through R13 and SW1. Why have they used zener instead of a normal high speed rectifying diode?


Figure-1:

I will add the decoupling capas and will post the modified block diagram.

Thank you for the good words.

  • S01575 signal diode on UNO
    (Vfwd = 1V)



  • Maybe add RXD/TXD designation ? :thinking:

I will preapre a set of quiz and design type questions for the pupils based on the Block Diagram where things as you have thought might be covered.

  • Suggest a separate capacitor from AVCC to GND ? :thinking:
    (My rule is one de-coupling cap per power pin.)

Then the 0V line connected to M8 is redundant.

But, DVCC and AVCC are shorted together in the Arduino UNO Board. In that case, should one decoupling capa not be enough?