在ubuntu18上烧写51

版权声明:本人所有博客,均为合法拥有版权或有权使用的作品,未经本人授权不得转载、摘编或利用其它方式使用上述作品。已经本人授权使用作品的,应在授权范围内使用,并注明原博客网址。违反上述声明者,本人将追究其相关法律责任。 https://blog.csdn.net/weixin_38071135/article/details/82879265

#怎么在ubuntu18上烧写51

  1. 安装编译工具:sdcc
sudo apt-get install sdcc 

sdcc官网

  1. 安装下载工具:stcgal
pip3 insyall stcgal

P.S:没有pip3或者没配置python3环境的.自行百度吧,挺简单的
stcgal的giuhub地址

  1. 例程(一个简单的流水灯:hello.c)
#include "8052.h"

#define uint unsigned int 
#define uchar unsigned char 
uchar tab[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};

void Delay(uint xms)
{
        uint i,j;
        for(i=xms;i>0;i--)
        for(j=110;j>0;j--);
}

void main()
{
        uchar i;
        while(1)
        {
                for(i=0;i<8;i++)
                {
                        P2 = tab[i];
                        Delay(100);
                }
        }
}

终端下:

sdcc hello.c
stcgal hello.ihx

如果出现什么问题,或者需要其他选项的时候可以看看上面两个工具的文档.

  1. waitting for cycle power
    是让你重启单片机的意思

如果你想请我吃个南五的话

猜你喜欢

转载自blog.csdn.net/weixin_38071135/article/details/82879265