linux下C51开发


开发工具mcu8051ide

下载地址http://sourceforge.net/projects/mcu8051ide/
安装sdcc

$ sudo pacman -S sdcc

根据README需要下载的依赖

REQUIRED PACKAGES : (Without these packages this program WILL NOT run)

|Package | min. Version | Where it's available | |---------|:------------:|---------------------------------------------------| |tcl | 8.5.9 |http://www.tcl.tk/software/tcltk/downloadnow84.html| |tk | 8.5.9 |http://www.tcl.tk/software/tcltk/downloadnow84.html| |itcl | 3.4 |http://sourceforge.net/projects/incrtcl | |tdom | 0.8 |http://tdom.github.com/ | |tkimg | 1.3 |http://sourceforge.net/projects/tkimg | |tcllib | 1.6 |http://sourceforge.net/projects/tcllib | |Tclx | 8.4 |http://tclx.sourceforge.net | |bwidget | 1.8 |http://sourceforge.net/projects/tcllib |

注:安装必要依赖可以下载源码包自己编译安装,因为我的是Archlinux,以下命令以Arch为主

安装tcl,tk,tcllib,bwidget

$ sudo pacman -S tcl tk tcllib bwidget

安装itcl,tdom,tkimg,tclx

$ yaourt -Ss itcl
aur/eclipse-dltk-itcl 5.0-1 (3)
    incr Tcl IDE for Eclipse
aur/itcl3 3.4.1-1 [installed] (1)
    Provides the extra language support needed to build large Tcl/Tk 
    applications, version 3.4
$ yaourt -S itcl3 #具体步骤略过
$ yaourt -S tdom
aur/tdom 0.8.3-1 [installed] (13)
    A fast XML/DOM/XPath package for Tcl written in C
aur/tdom-git 0.8.3.r92.g363cbda-1 (4)
    A fast XML/DOM/XPath package for Tcl written in C
$ yaourt -S tdom
$ yaourt -Ss tkimg
aur/tkimg 1.4.2-1 [installed] (3)
    This package enhances Tk, adding support for many other Image formats: 
    BMP, XBM, XPM, GIF, PNG, JPEG, TIFF and postscript.
$ yaourt -S tkimg
$ yaourt -Ss tclx
aur/tclx 8.4-4 (19)
    Provides OS primitives, file scanning, data records etc. for Tcl
aur/tclxml 3.2-2 (4)
    XML support for the Tcl scripting language
aur/tclxosd 0.20-2 (2)
    A Tcl bindings for libxosd (On Screen Display)
$ yaourt -S tclx #这里发现一个问题,我tclx没有装但mcu8051ide也能正常使用

安装mcu8051ide

解压源码包,进入源码包目录

$ cmake . -DCMAKE_INSTALL_PREFIX=/opt/mcu8051ide/ #不要忘记".",后面的是要安装到的目录
$ make
$ sudo make install

打开使用mcu8051ide

$ cd /opt/bin
$ ./mcu8051ide --check-libraries #检查依赖是否安装好
$ ./mcu8051ide #打开软件

ok,可以编写程序了

单片机烧写

使用软件gSTCISP

下载地址

安装gSTCISP

解压缩软件

$ cd gSTC-ISP
$ ./configure --prefix=/opt/gSTCISP/
$ make  #如果直接make会出错,cd 到src目录,vim Makefile将CFLAGS = -g -O2更改为CFLAGS = -g -O2 -I/usr/include/vte-0.0/
$ sudo make install

使用gSTCISP

$ sudo gSTCISP  #如果直接使用gSTCISP打开,烧写时会提示没有权限,请使用root权限打开

选择 /dev/ttyUSB0 (or 1) 和 4800 bauds
然后点击下载


ok,可以在linux系统下开发C51单片机了

Author: honmaple

NO CONTENTS

lin.jiang

风落花语风落天,花落风雨花落田.