MCU-based embedded designs

[00]Foreword

The world of MCU-based embedded designs can be divided into those that take advantage of existing code and MCUs, and those that require leading edge MCU architectures and implementations.

[01]Introduction to Embedded Systems

An embedded system is an application-specific computer system which is built into a
larger system or device. Using a computer system enables improved performance, more
functions and features, lower cost, and greater dependability. With embedded computer
systems, manufacturers can add sophisticated control and monitoring to devices and other
systems while leveraging the low-cost microcontrollers running custom software.

[02]Microcontroller Concepts, Infrastructure, and Interfacing

Embedded systems consist of computers which are embedded in larger systems. Additional circuitry such as power supplies, clock generators, and reset circuits, are required for the computer to work. Transducers (devices that convert one type of energy into another) are also used to connect microcontrollers to the outside world. There are two classes of transducers: inputs and outputs. Inputs (sensors) include devices such as switches, temperature sensors, keypads, and buttons. Output transducers include devices such as LEDs, motors, and coils.

  • Volatile memory is typically used to hold data which changes as the program runs.
  • Interface peripherals communicate with external devices to sense the values of input signals and control the output signals.
  • Internal peripheral devices provide additional functions without the need for external interfacing.

Power Supply

[待研]

Clock Signal Generation

[待研]

Reset Circuit

[待研]

General Purpose Digital I/O Basics

Embedded systems consist of computers embedded in larger systems. The processor needs to sense the state of the larger system and environment, and control output devices. The most basic way to do this is through one or more discrete signals, each of which can be in one of two states (on or off). General purpose digital I/O ports are the hardware which can be used to read from or write to the system outside the microcontroller.
The RL78 has multiple I/O ports, numbered starting at P0. Each port typically has eight bits, with each bit connected to a specific pin on the MCU package. For most ports, each bit can be configured individually as an input or output, although there are some limited-function port bits which have partial configurability such as input-only.
A port pin may serve several purposes; for example, one might be used as a general purpose I/O pin, as anA/D converter input, or as an interrupt input, based on how it is configured. Depending on the purposes these pins serve, they might have extra registers.

Control Registers

There are multiple registers used to control and monitor ports. We can find the details of these registers in the User's Manual (Renesas Electronics Corporation 2011) chapter on Port Functions.

  • The Port Mode register (PM) controls whether a particular port bit is an input (selected with 1) or an output (0).

端口模式寄存器(PM)控制特定端口位是輸入(選擇1)還是輸出(0)。

  • The Port register (P) holds the data value for the port. For example, if port 0 is configured as all inputs, then reading from register P0 will indicate what binary input values are present on the pins of port 0. If port 1 is configured as all outputs, writing to register P1 will cause those binary values to appear on the pins of port 1.

端口寄存器(P)存放該端口的數據。例如,如果端口0的所有位全部配置為輸入,那么讀出寄存器P0將指示出端口0所有引腳上的二進制輸入值。如果將端口P1的所有位全部配置為輸出,那么寫入寄存器P1將使得寫入的二進制數值顯現在端口1的所有引腳上。

  • The Pull-Up resistor option register (PU) controls whether an internal pull-up resistor is connected (selected with 1) to that input bit or not (0).

上拉電阻選擇寄存器(PU)控制內部上拉電阻是連接(使用1來選擇)還是不連接(0)。

  • The Port InputMode register (PIM) controls which type of voltage threshold (TTL or CMOS) is used to determine whether an input is a 1 or a 0. The CMOS thresholds (normal, selected with 0) are proportional to the supply voltage VDD, while the TTL thresholds (1) are fixed voltages.

端口輸入模式寄存器(PIM)

  • The Port OutputMode register (POM) controls whether an output can be driven up or down (push-pull mode, selected with 0), or just down (N-channel open-drain, selected with 1). This is useful for applications such as sharing a bus which may be driven by other devices.

  • The Port Mode Control register (PMC) controls whether an input is used for analog (selected with 1) or digital (0) purposes.

  • The Peripheral I/O Redirection register (PIOR) allows certain peripheral signals to be routed to one of two possible port pins, simplifying circuit design.

INTERFACING WITH ANALOG SIGNALS####

The world is not digital; it is analog. Microphones, thermometers, speakers, light sensors, and even video cameras are all analog sensors. As a result, the signals from these sensors must be converted to digital values so that the microcontrollers can process them.

[03]RL78 CPU Core and Interrupts

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的閱讀 13,534評論 5 6
  • 今天我哄兒子睡覺,放下后本想去做自己的事情,結果他剛好醒了,正好看到現在準備離開的身影,竟然開始嘰歪起來,我媽趕緊...
    甄程很自律閱讀 125評論 0 0
  • 三年又三年,時光飄忽的那么不真實。所有關于日子的記憶全是擁擠的車廂和吵鬧的人群。 少小離家,從小城鎮到大城市,為著...
    沈小凹閱讀 387評論 0 2