分页: 1 / 1

avrdude实现8051芯片烧录

发表于 : 2009-12-31 22:27
soloflight
一直以来都是用ubuntu虚拟xp弄烧录,今天在网上找到了一文章,终于可以在linux上面烧录了!希望对新手有帮助.

前提要有一个usbasp下载器。

http://www.fischl.de/usbasp/ 这是他的网站,在taobao上也有卖。



sudo apt-get install avrdude

然后编辑avrdude.conf:

sudo gedit /etc/avrdude.conf

在最后面加入AT89s52的相关信息(这是Joy Shukla写的)

#------------------------------------------------------------
# Below chips by added by me .. Joy Shukla(joy_shukla@yahoo.in)
# these chips can be programmed with my usbasp programmer(changed atmega8 program)
# after adding avrdude support in this file ..
#------------------------------------------------------------

#------------------------------------------------------------
# AT89S52
#------------------------------------------------------------
part
id = "8052";
desc = "AT89S52";
signature = 0x1E 0x52 0x06;
chip_erase_delay = 20000;
pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1",
"x x x x x x x x x x x x x x x x";

chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x",
"x x x x x x x x x x x x x x x x";

timeout = 200;
stabdelay = 100;
cmdexedelay = 25;
synchloops = 32;
bytedelay = 0;
pollindex = 3;
pollvalue = 0x53;
predelay = 1;
postdelay = 1;
pollmethod = 0;

memory "flash"
size = 8192;
paged = no;
min_write_delay = 4000;
max_write_delay = 9000;
readback_p1 = 0xff;
readback_p2 = 0xff;
read = " 0 0 1 0 0 0 0 0",
" x x x a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" o o o o o o o o";

write = " 0 1 0 0 0 0 0 0",
" x x x a12 a11 a10 a9 a8",
" a7 a6 a5 a4 a3 a2 a1 a0",
" i i i i i i i i";
mode = 0x21;
delay = 12;
;

memory "signature"
size = 3;
read = "0 0 1 0 1 0 0 0 x x x 0 0 0 a1 a0",
"0 0 0 0 0 0 0 0 o o o o o o o o";
;
;
#------------------------------------------------------------
然后保存
现在就可以烧录AT89S52的单片机了,
例如我想烧录放在桌面上的编译好的跑马灯程序,
用命令

sudo avrdude -p 8052 -c usbasp -e -U flash:w:'./跑马灯.hex'
Screenshot-5.png
Screenshot-4.png
顺便问下各位大哥们,avr-gcc能编译c51的代码不?我正缺少个编译器。

Re: avrdude实现8051芯片烧录

发表于 : 2009-12-31 22:35
eexpress
烧录的,只和硬件设备有关吧。
你这JTAG?

Re: avrdude实现8051芯片烧录

发表于 : 2009-12-31 22:43
soloflight
JTAG?不知道是什么,我刚学点8051一直都在用at89s52芯片,你知道有那些编译器可以编译c51?gcc-avr可以写51的程序不?

Re: avrdude实现8051芯片烧录

发表于 : 2009-12-31 23:12
eexpress
只有一个不好的sdcc编译啊。

Re: avrdude实现8051芯片烧录

发表于 : 2009-12-31 23:52
soloflight
除了sdcc就没有了?

Re: avrdude实现8051芯片烧录

发表于 : 2010-02-07 1:36
soloflight
现在又发现还有一个asem51也很好用,如果我用usb转串口有支持的烧录器不?

Re: avrdude实现8051芯片烧录

发表于 : 2010-04-28 22:14
oxangen
烧进52芯片比烧avr要慢,请问楼主上面的文件是不是有些数据可以改小一点?

Re: avrdude实现8051芯片烧录

发表于 : 2010-11-22 23:28
tonghuix
不错,收藏一下
如果可以的话,理论上可以把这个东西改造成万能烧写器

Re: avrdude实现8051芯片烧录

发表于 : 2011-10-26 12:46
zhaoqingyu51
soloflight 写了:现在又发现还有一个asem51也很好用,如果我用usb转串口有支持的烧录器不?

可是我的有点问题啊。。。

Re: avrdude实现8051芯片烧录

发表于 : 2012-04-23 0:19
ashf
这个配置文件stk200的并口下载器可以用吗
我测了一下不成功,不知道是不是配置的问题

代码: 全选

$ avrdude -p 8052 -c stk200 -e -v

avrdude: Version 5.11.1, compiled on Dec  4 2011 at 15:16:50
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/home/a/.avrduderc"

         Using Port                    : /dev/parport0
         Using Programmer              : stk200
         AVR Part                      : AT89S52
         Chip Erase delay              : 20000 us
         PAGEL                         : P00
         BS2                           : P00
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         33    12     0    0 no       8192    0      0  4000  9000 0xff 0xff
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : PPI
         Description     : STK200
           VCC     =  (not used)
           BUFF    = 4,5
           RESET   = 9
           SCK     = 6
           MOSI    = 7
           MISO    = 10
           ERR LED = 0
           RDY LED = 0
           PGM LED = 0
           VFY LED = 0

avrdude: AVR device not responding
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.