Modify the source code of EasyPro51 programmer on SDCC, compile and run successfully

Publisher:轻松自在Latest update time:2015-07-15 Source: 51heiKeywords:EasyPro51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Because I had some time, I started to develop 51 MCU. I found that I couldn't compile 51 MCU programs on Linux (Debian and Ubuntu), so I had to download Keil from the Internet. Then I used wine to emulate it. But it kept crashing. There were also problems with the code. Then I changed to running it in a virtual machine. But it was still not satisfactory! I didn't know what convenience was until I found SDCC. Some syntax in Keil needs to be corrected in SDCC.

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

Keywords:EasyPro51 Reference address:Modify the source code of EasyPro51 programmer on SDCC, compile and run successfully

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

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号