'AT89X52.BI
Keywords:SDBC
Reference address:Special registers of SDBC (bit-addressable definition method)
'For 52 compatible MCU 'Const variables and Const variables are calculated at compile time 'By Wan Zhiyuan, sdbc 'Define bit-addressable data types Type SFR_BIT_A Dim SFR_BIT_A As sfr 'Define the byte address sfr. If there is a variable with the same name as Type in Type, the compiler will treat it as the default variable 'For example, if there is SFR_BIT_A in this type, then the external address for this class is actually the address for this variable 'For example, Dim P0 As SFR_BIT_A at &H80, then P0=0 is equivalent to MOV #80H,0. 'Then if you need a numeric variable name, you need to add $ in front of it, but if you reference it outside the class/type, you don't need to do that. The with statement also needs it. 'Similar to P0.0=1. With P0.$0=1 End With 'Address declarations in type will be fixed at compile time, similar to declaring P0 at 0x80, then $0~$7 are fixed to 0x80~0x87 Dim $0 As sbit at &SFR_BIT_A Dim $1 As sbit at &SFR_BIT_A+1 Dim $2 As sbit at &SFR_BIT_A+2 Dim $3 As sbit at &SFR_BIT_A+3 Dim $4 As sbit at &SFR_BIT_A+4 Dim $5 As sbit at &SFR_BIT_A+5 Dim $6 As sbit at &SFR_BIT_A+6 Dim $7 As sbit at &SFR_BIT_A+7 End Type 'IO port definition Dim P0 As SFR_BIT_A at &H80' declare P0 at position 0x80 Dim P1 As SFR_BIT_A at &H90' declare P1 at position 0x90 Dim P2 As SFR_BIT_A at &HA0' declare P2 at position 0xA0 Dim P3 As SFR_BIT_A at &HB0' declare P3 at 0xB0 'IO port definition ends
Previous article:Finally, I have figured out the 12232 microcontroller driver.
Next article:STC89 series header files used by SDCC
- Popular Resources
- Popular amplifiers
Recommended Content
Latest Microcontroller Articles
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
He Limin Column
Microcontroller and Embedded Systems Bible
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
MoreSelected Circuit Diagrams
MorePopular Articles
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
MoreDaily News
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Guess you like
- Free review: HuaDa M4 core HC32F460 board, #all serial communication ports, GPIO can be freely mapped# Is it fresh?
- Playing with Zynq Serial 13 - Using GIT for project backup and version management 5
- IGBT drive circuit
- Comparison of 4G and 5G wireless technology details
- EEWORLD University Hall----MCU Peripheral Circuit_Lao Wu MCU Actual Combat
- Audio Circuit Debugging Tips
- [TI recommended course] #Industry's first professional RGB LED driver LP50xx demonstration #
- How to configure the background of Hikvision Ai equipment and thermal imaging equipment? What is the difference between them and ordinary network cameras? Please ask the experts! !
- How to get a multi-channel reference power supply
- TMS320F28335GPIO Example - Light up the LED