Probably okay to have just one. However, the VCC and AVCC pins are separated,
i.e. on opposite sides of the I.C.
There is definitely a good argument for having two capacitors.
This would be especially true if for noise isolation you had a VCC power puddle and AVCC power puddle.
General comment: it would be nice if the individual sections could refer to the more detailed diagrams in the datasheet, which means attempting to be consistant with the terms used there...
I guess I'll go in order. First, the diagram.
M1: "Sequence Generator"? Everyone else calls it a "Program Counter", unless you meant to imply more than just the PC (which I think goes unncesarilly deep into the structure of a CPU.)
M2, M3: an AVR does not have a "result register"; the output of the CPU goes back into the register set. If you were talking about the "status register" , you should call it that and include flags other than Carry. (though I suppose at a HLL view, Carry is more important than the others, since you'll want to be able to explain how an 8bit CPU/ALU does 16/32bit math.)
M4, M5: I'd separate out the Fuse and Lock bits. While deep down they probably are implemented as a row of flash memory, they're not in the normal address space(s), and their functions aren't just relevant to the memories.
M6: you don't show where the SFRs for the peripherals exist (they're here in the RAM address space.) That might be a relatively important thing.
M7, M8: 0V or GND? I agree that this should show bypass caps, if you're going to show any external circuitry at all. The division between "analog" and "digital" power is not as clean as implied - AVCC drives some digital electronics as well as the analog circuitry. (And there is very little in the way of actual "analog elections" - probably just a couple of comparators (one for the comparator peripheral, one for the ADC (which is otherwise a bunch of digital stuff.) (Some newer product data sheets are more careful about assigning certain pins and peripherals to certain "power domains.") I think it would be better to move the power module down next to the "power management unit" module.
M9: the reset circuitry is atypical, and certainly not what is present on most Arduinos. C1 is rarely present, interferes with debugging, and might interfere with ISP programming (it would certainly interfere with the Arduino's auto-reset feature.) I think it's occasional recommendation dates to days of less adequate power supplies and no "brown-out" circuitry. R1 is lower than an Uno (10k) and higher than many Nano Clones (1k)
M10: shows a crystal, but not the required caps. If it's supposed to be a reasonator (as per Uno), there should be a ground connection. Or not, if you don't want to go into that detail. The ATmega328 can use a wide variety of crystals, up to 20MHz and down to 32kHz.
M11: looks like it's pointing to the PMU. Neither of M10/M11 show the clock divider. You don't include the ~128kHz clock used by WDT and some internal functions (also selectable as a CPU clock.)
M12: WDT has a separate clock. It's somewhat important that this clock is separate.
M13: move the power stuff (M7, M8) down here?
M14, M15, M16: Your desire to group functions with the pins on which they might appear is understandable, but a bit problematic (and as you point out, inconsistent with the datasheet.) For example, PCINT and HWINT (please change "HINT"; it took me too long to figure out that that was an abreviation rather than a word!) aren't "alternate" so much as "secondary" (Ie they don't interfere with whatever other function is in use on the port.) And the alternate functions on this particular chip go to specific pins on the port, not just "somewhere on portX."
. There is no "PWM" peripheral on these AVRs, just timers that can be used to generate PWM. This is vaguely important since there are other chips that DO have a separate PWM peripheral. (how come PORTB doesn't show TC functions?)
. AVR calls the "ICP" function "ISP."
Or assorted other external crystals or oscillators, including a low-power low-frquency crystal driver designed for 32.768kHz "watch crystals."
The prescaler can be used with any clock source. Using the 32kHz crystal oscillator as a source, you could operate down to 128Hz (!) Using the WDT oscillator (~128kHz; not precise) you could go down to 500Hz. (this level of detail might not be desirable!)
Do you want to mention non-5V power options?
I'm not sure that describing the ports as multiple 1-bit latches is a good idea. Sure, that's how Arduino treats them, but... (also, adds confusion when talking about the alternate functions.)
Keyboard? Display? Not always, especially with Arduino applications!
"It can do addition or other operations on two 8bit data at a time."
I'm not sure "temporary" is appropriate/necessary here; after all, in a long-running Arduino program, data in RAM can last for as long as power is on - months, perhaps. I'm not sure what a better term would be. "holds data with changeable content ("variables") that is in use by the program"?
Looks weird.
The main references ought to be AN2519: AVR® Microcontroller Hardware Design Consideration, which says the zener should limit the RESET voltage WRT ground.
In the case of Arduino, the diode is specifically required because the auto-reset cap can act as a sort of voltage doubler and cause the voltage on RESET to move up into "High Voltage programming enabled" range.
I dunno. The official diagram shows direct connections from USART to PORTD, SPI to PORTB, and TWI to PORTC, quite similar to GM's diagram. It ALSO shows the connections to the databus, which somewhat obscures this.
Note that other, newer, processors are more careful about defining "alternate functions" of each pin, making either style of document even more complicated. (For instance, the USART on an ATtiny3216 can be routed to either PORTB or PORTA. Some chips have a full matrix switch allowing nearly any function to be routed to any pin...)
First of all, I extend my thanks and gratitude for your #23, #24, and #25 which have brought to me enormous information many of which were unknown to me before. Your constructive comments will help me to correct/improve my text and Block Diagram to describe the functionlities of the processing modules of the MCU.
I am going through all the posts again and again and trying to figure out how to accomodate your recommended features in my Block Diagram without making it too populated. As I have said that the intention of my effort was qualitative and learning instaed of quantitative and engineering.
In fact, I have wanted to create a basic (simple and elementary) Block Diagarm lookig at which the readers/students can easily find out the organization of various processing modules that are present within ATmega328 MCU.
Before I present the Block Diagram of Fig-4 to the pupils, I present the following two diagrams (Fig-1, Fig-2) as preambles for the definition of Microcontroller (= MPU + Memory + Port).
Sequence Generator (name I have learnt/taken from Text Book 30 years ago)
It is the Control Matrix that generates complex timing functions to sequentially fetch opcode, decode opcode, generation of next address (es) to read the operands, and etc. By sequence generator, I understand the iland that is shown with 8085 MPU of Fig-3.
Result Register
In AVR, the result of ALU operation can go to any of the permissible registers of r0 - r31 which I have wanted to mean by saying "Result Register" and NOT giving any particular register name. I will add a small block adjacent to the Result Register for the Status Register and showing the symbolic names of the flags.
Alternate Function
At power up, all the port lines appear as digital input lines; so, this is the primary function of the Port-B/C/D of ATmega328P. Data sheet says that the "alternate functions" (and NOT "Seconday Functions) of the port lines can be confirued by software intialization. When PD0 and PD1 are configure to work as IO lines, they cannot be used as UART lines and vice versa. In realiy, either the primary or the alternate function of the IO lines are present.
Yes! PB1 does generate PWM signal. I will add it in the Blcok Diagarm.
By ICP (ICP1), I mean "Input Capture Unit of TC1". Port-B supports ISP (In System) Programming Interface (alternate function of PB2-PB5) which I will add in the Block Diagram.
Special Function Registers
Mapping of the Ports/Timers/Peripherals and the associated control/status registers against RAM locations.
I am afraid that the accomodation of this information in the Block Diagram would make my Block Digram clumsy. I will include it in the lecture material.
I will add this module in the Block Diagram.
I will add a crystal with WDT Module to meanseperate clock.
Yes! It should be HWINT to mean External Hardware Interrupt. I will do the change.
Can we say like: 1-bit latch during digital IO operation.
In general, they should be "Inpu Device" and "Output Device".
16-bit ALU Operation
Atmega328P is an 8-bit processor, and it can process two 8-bit data in one GO (during 1 cycle). Can it process (say, add) two 16-bit data in one 1 cycle period?
I ave learnt another way of defining RAM Memory.
I have now better understanding of the role of diode (D1, Fig-4) in the reset circuity. Without diode, the transient voltage (RST switch On/Off or auto reset) could be as much as => 12V High Voltage Programing stress which might corrupt the content of the Flash/EEPROM.
Latest/Edited Block Diagram that includes some features of your recommendtion:
I'm sure it's perfectly clear to you because it's your diagram. I'm just pointing out that someone else like me seeing it for the first may be confused by those 0V lines that seem to connect to pins.
You asked for comments but it seem you are more concerned about defending the correctness of what you already have.
Just a remark that I guess the AVRs are probably the last microcontrollers where the documentation supports the exercise you are doing in that you are using it as a basis for teaching the internal hardware architecture. With more modern microcontrollers, say the ESP32, documentation is not provided at that level and you get instead a series of APIs in the development system keeping the programmer one or more abstraction layers away from the real hardware.
I suppose electronic engineers may also be interested in implementation details like the GPIO pin protection methods which are employed on the microcontrollers (clamp diodes, snapback to ground etc.) or maybe the characteristics of the analog comparator. Here the data sheets are generally not particularly helpful.
I don't think that ESP32 is a good example because it is a proprietary product.
Look to STM32 documentation, you can find a lot of hardware details in it.
IMHO (take it or leave it ) I would just use the Atmega data sheet , it has the added advantage that everything is there and the student gets used to data sheets and their format.
For “ how a processor “ works type stuff it might be easier starting with something old school like a Z80, 6502 which don’t have “ complex” bits in them .
In spite of the presence of data sheets, 3rd parties prepare and publish Text Books, Reference Books, Cook Books, App Notes, and etc. based on data sheets for alternate (sometimes better) understanding of the architecture of ATmega328P MCU.
0V-point of external power supply is connected with PPin-22/8 of the ATmega328P MCU. (PPin stands for Physical Pin). The change is reflected in Fig-1B of #1.
It is very explicitly a low-precision RC clock. If you haven't used a crystal symbol for the internal 8MHz clock, you shouldn't use one for the WDT clock, either.
Let me change the symbol from crystal to circle (Fig-1) for WDT Module and adding "Instruction Sequencer" along with "Sequence Generator". I have also added BOD Crcuit (M17).
According to Google, "Instruction Sequence" is much more appropriate than "Sequece Generator'. However, I will look for my old book and will post quote from there in support of "Sequence Generator".
I have not seen any hardware or text for myself in saying that ESP32 MCU contains a 32-bit processor; but, I have assumed that it should be.
This is now what I have found in Google search: Search Labs |AI Overview
Yes, the ESP32 is indeed a 32-bit processor. Specifically, it utilizes a 32-bit Tensilica Xtensa LX6 microprocessor, which is a dual-core processor in most versions, and can be clocked at 160 or 240 MHz. There are also single-core versions available. Some newer ESP32 variants, like the ESP32-S3, use a 32-bit Xtensa LX7 dual-core processor. The "32" in ESP32 refers to this 32-bit architecture.