For example, to light up the LED at port P0.1, write
sbit LED=P0^1;
void XXXX(void)
{
LED=1;
LED=0;
while (1){}
}
But it doesn't work in sdcc. I checked online and found this method:
__sbit __at 0x80 LED;
//或者#define LED P0_1
void XXXX(void)
{
LED=1;
LED=0;
while (1){}
}
This is the right way.
There are also some details in sdcc, such as
unsigned char Data;
while (!ReadData()==Data){}
This is wrong. Because in sdcc, you did not define Data as signed char. So it will report an error saying that this is not a signed bit.
The writing method in sdcc is: (ReadData!=Data).
OK. The E51PRO source code after modification, compilation and flashing is here: EP5-SDCC-src.tar.bz2
Previous article:Read and write operations of IIC devices, everyone take a look at this so-called "tutorial"!!
Next article:Protocol Analysis of STC12C Series
- Popular Resources
- Popular amplifiers
- 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)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- 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
- 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
- Share some of my experiences as a part-time communication designer
- EEWORLD University Hall----Live Replay: Energy Saving and Carbon Reduction-Omron Relay, Switch, and Connector Solutions for Photovoltaic Inverter/Energy Storage Systems
- Nonlinear Compensation Method for Sensor Bridge Circuit
- DIY_boostxl-k350qvg under the recent proofing storm
- Today is 520, another beautiful day for confession. What actions will you take?
- Design and Implementation of Digital Video Conversion Interface Based on FPGA
- CR Micro's 8-bit microcontroller CS98P154 with OTP ROM
- [Lazy people take care of fish tank control system] Debug method in ON Semiconductor IDE environment
- W5500 UDP Issues
- Where should the fuse be connected?