linux下怎么编译单片机c代码,怎么下载到51单片机上呢

linux下怎么编译单片机c代码,怎么下载到51单片机上呢,第1张

1.编译软件用sdcc

2.sdcc不支持keil51c 的一些语法。要做以下修改:

sbit led1=P1^0 改为 #define led1 P1_0

中断函数interrupt改为__interrupt

单个位 P1^0 改为P1_0

若vim安装插件YCM的话,要在.ycm_extra_conf.py加入以下两个路径

/usr/share/sdcc/include

/usr/share/sdcc/include/mcs51

没创建一个工程都要拷贝一份.ycm_extra_conf.py到该工程的目录下。

3.编译用命

` sdcc 目标文件

4.烧录软件用stcflash.py,该软件只能支持stc89c52rc,不支持stc89c52。我自己亲自试过。

sudo python ./stcflash.py 目标文件

该只能支持stc89c52rc。

sudo python :

sbit led1=P1^0 改为 #define led1 P1_0

中断函数interrupt改为__interrupt

单个位 P1^0 改为P1_0

若vim安装插件YCM的话usr/shareǘsdcc/include/mcs51

没创建一个工程都要拷贝一份.ycm_extra_conf.py到该工程的目录下。我自己亲自试过。

3.编译用命令

` sdcc 目标文件

4.烧录用stcflash.py,不支持stc89c52./stcflash,要在.ycm_extra_confinclude

47.py加入以下两个路径

/usr/share/sdcc47


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8929112.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-23
下一篇2023-04-23

发表评论

登录后才能评论

评论列表(0条)

    保存