Open flip111 opened 5 years ago
I will make a PR for this maybe
Peripheral is usually used for nearby chips that interface with the microcontroller. Although the definition can extend to more things this is not usually how it's described on product pages.
That's not accurate. I think the problem is that the incorrect use of the word microcontroller in the context: A peripheral is anything that connects to the processing core(s) to extend the functionality or connect to the outside world (hence the mention of APB, AHB, etc. in the datasheets).
@therealprof In the text "Peripheral" is opposed to "CPU, RAM, or Flash Memory" because when describing peripherals it's contrast it with that because of the wording "more than just".
A peripheral is anything that connects to the processing core(s) to extend the functionality or connect to the outside world
Is this the alternative definition you provide? I didn't understood this.
I just like to avoid the word peripheral if it gets ambiguous. Or else use the manner in which it's used most in lecture, even if people use it wrongly.
This issue covers quite a few different parts of the chapter. I think you've highlighted some good examples of where we could be clearer with language or things could be explained better. On the other hand I strongly feel like "peripheral" is the correct word to describe on-chip components such as the ADCs, DMA, CRC block, timers, GPIO, comparators/opamps, etc etc. The datasheets and reference manuals do this, Wikipedia does this, it's common vernacular for embedded development.
For example, the STM32F405 datasheet:
Our description of them as just "used for interacting with systems outside of the microcontroller" could be made more broad (you're right in that the CRC etc wouldn't be covered by this), and the description of offloading processing likewise could be expanded (it makes sense to talk about offload with the CRC peripheral or with the DMA or even SPI/I2C when you could bitbang those in software; we don't use offload to refer to the GPIO or ADC so much).
I'll leave off discussion of the memory map bit for now.
@flip111 Peripherals are additions hooked up to a bus to provide extra functionality. With MCUs they're usually built into the same chip and the busses are not exposed externally in contrast to a general purpose CPU which contains few or no built-in peripherals but exposes one or more busses so external chips can (or have to be used) to provide peripherals.
On the other hand I strongly feel like "peripheral" is the correct word to describe on-chip components such as the ADCs, DMA, CRC block, timers, GPIO, comparators/opamps, etc etc. The datasheets and reference manuals do this, Wikipedia does this, it's common vernacular for embedded development.
Yes i totally agree with this. Excuse me this was not clear or if i'm backtracking a bit on my words. I actually see that i wrote the wrong thing. Instead of:
But under the definition of the book, the following items would also be peripherals:
I should have written:
But under the definition of the book, the following items would NOTbe peripherals:
because i tripped over the part outside of the microcontroller
https://rust-embedded.github.io/book/peripherals/index.html
This is not usually how the word "peripheral" is used. For example take the microcontroller from the STM32F3DISCOVERY board. https://www.st.com/en/microcontrollers/stm32f303vc.html
When you search for peripheral you will find sentences in the context of APB and I2S buses.
But under the definition of the book, the following items would also be peripherals:
And the following would be left undiscussed:
Peripheral is usually used for nearby chips that interface with the microcontroller. Although the definition can extend to more things this is not usually how it's described on product pages.
This is wrong wording "offload". It's not as if an ADC for example can be run in software. Maybe when talking about "offloading" it is again in the sense that there are co-processor-like IC's on the same board.
One could argue that the input of an ADC can not come from "a system", but could it?
Suggestion: Rename the chapter from peripherals to "on-chip hardware". Then split this section into hardware that interfaces through the pins of the microcontroller and hardware that can not use a pin.
I would remove the computer history from this chapter. The point is that some things are always a necessity for a CPU (even since the old days). The chapter should start with these essential things as a small introduction and then later dive into the "on-chip hardware" explanation.
This can not be understood by itself. It's missing an introductory sentence to the next paragraph. Add: "which will be explained in the following section"
also
? no othervalid action
was covered before.Memory address space
This is not explained well enough. What should be explained here is that the memory address space is split into a section for the RAM and a section for I/O (and perhaps more sections). From the software it looks all like memory but the hardware starts to activate certain parts of the hardware.
It's a very noisy read to dive into
Linear and Real Memory Space
section, start reading about MMU immediately, followed by "but we don't need an MMU anyway"I don't think there is any audience which is interested in making the distinction between "real" and "virtual" or "linear" and "non-linear" address spaces.
The point is not that the address space is so big that there is space remaining for memory mapped I/O. Instead there is 1. RAM 2. memory mapped I/O therefor it must follow that a sufficiently large memory space is required to address both.
--
In general this section is littered with too many addresses and too many internals.
Suggested rewrite of section "Linear and Real Memory Space" rename to "Memory mapped input output".