(i.e., function) of the data memory of different models of PIC microcontrollers is not exactly the same, so once the designer selects a certain model of PIC microcontroller, he often needs to find the data memory information of the microcontroller for programming.
The author takes the initialization of RB port (RB7, RB6...RB0) in the source program written by PIC16F84 in the MPLAB integrated development software environment as an example to explain the method of selecting storage bank 0 or 1 as follows:
Program list
file: PIC01.ASM
List P=16F84
#include P16F84.inc
STATUS EQU 03H
RB EQU 06H
TRISB EQU 86H
ORG 0x00; Reset vector (PIC16F84)
GOTO MAIN; Go to the beginning of the main program
ORG 0x08; Store the program from address 08H
MAIN
CLRF PORTB; Initialize
BSF STATUS, 5; Set RP0 to 1, select Bank1
; In order to set register TRISB
MOVLW 0x0F; Initialize data 00001111B
MOVWF TRISB; RB port D3~D0 is input;
… ; D7~D4 are outputs
The above example shows that the register TRISB in the source program is in the storage bank 1 (Bank1) of the 16F84 data memory, so the purpose of selecting TRISB is achieved by programming.
Previous article:Pseudo instructions for PIC series microcontrollers
Next article:PIC8-bit microcontroller source program assembly and curing under Windows (I)
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Hong Kong robbers targeted chips, and chips worth 5 million Hong Kong dollars were robbed!
- EEWORLD University----What is Electrostatic Discharge (ESD)?
- [Project Source Code] Unable to download FPGA program, unable to start, downloader not found
- [phyBOARD-i.MX 8M Plus Development Board] Part 1: Unboxing and Hardware Appreciation
- [Synopsys IP Resources] Verification Developer's Perspective: How to Achieve Automotive Functional Safety?
- 【STM32WB55 Evaluation】_04_WEB Control Experiment
- The History of Industrial Ethernet Protocols and Their Advantages
- Using a barometer to record aircraft cabin pressure?
- Why does the RS232 serial port signal change?
- What is an inductive distance sensor?