Register Pair Operations Table 2.3 shows basic operations that can be applied to pairs of registers. The result is retained in one of them, the destination register. The data to be combined with the contents of the destination register is obtained from the source register, typically W or a literal (number supplied in the instruction). […]
Continue reading…
Posts by Farahat
Microcontroller Operation:Single Register Operations
Single Register Operations The processor operates on 8-bit data stored in RAM registers and W. The data can originate in three ways: • A literal (numerical value) provided in the program • An input via a port data register • The result of a previous operation. This data is processed using the set of instructions […]
Continue reading…
Microcontroller Operation:Program Operations
Program Operations We can see in Appendix A that a machine code program consists of a list of binary codes stored in the microcontroller memory. They are decoded in sequence by the processor block, which generates control signals that set up the microcontroller to carry out the instruction. Typical operations are: • Load a register […]
Continue reading…
Microcontroller Operation:Special Function Registers
Special Function Registers These numbered registers provide dedicated program control registers and processor status bits. In the PIC, the program counter, port registers and spare registers are all mapped as part of a block that starts at zero and ends at 0Bh in the 16F84A. For example, the program counter is register number 02. The […]
Continue reading…
Microcontroller Operation:Arithmetic and Logic Unit and Port Registers
Arithmetic and Logic Unit This is a combinational logic block that takes one or two input binary words and combines them to produce an arithmetic or logical result. In the PIC, it can operate directly on the contents of a register, but if a pair of data bytes is being processed (e.g. added together), one […]
Continue reading…
Microcontroller Operation:Instruction Register and Decoder
Instruction Register and Decoder To execute an instruction, the processor copies the instruction code from the program memory into the instruction register (IR). It can then be decoded (interpreted) by the instruction decoder, which is a combinational logic block which sets up the processor control lines as required. These control lines are not shown explicitly […]
Continue reading…
Microcontroller Operation:Program Memory and Program Counter
Program Memory Microcontrollers used for prototyping and short production runs use flash memory to store the program. The program can be downloaded while the chip is in the application circuit (in-circuit programming). Alternatively, the chip is placed in a programming unit attached to the host computer for program downloading, before fitting it in the application […]
Continue reading…
Microcontroller Operation:Microcontroller Architecture
Microcontroller Architecture The architecture (internal hardware arrangement) of a complex chip is best represented as a block diagram. This allows the overall operation to be described without having to analyze the internal circuit, which is extremely complex, in detail. PIC data sheets contain a definitive block diagram for each chip. Our starting point is the […]
Continue reading…
Computer Systems:Programming a Microcontroller
Programming a Microcontroller For the examples in this book, we will be using PIC chips that have flash ROM program memory, which can be easily erased and reprogrammed. This is very useful when learning, but also allows the firmware (microcontroller program) to be upgraded in any application, adding an app to a mobile phone, or […]
Continue reading…
Computer Systems:Microcontroller Application Design
Microcontroller Application Design A simple microcontroller-based equivalent of the word-processing application described above is shown in Figure 1.9. The purpose of the system is to store and display numbers that are input on the keypad. Four inputs and three outputs are required for keypad connection to the microcontroller, but to simplify the drawing, these parallel […]
Continue reading…