avrdude实现8051芯片烧录

内核编译和嵌入式产品的设计与开发
回复
头像
soloflight
帖子: 6
注册时间: 2009-12-31 22:05

avrdude实现8051芯片烧录

#1

帖子 soloflight » 2009-12-31 22:27

一直以来都是用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([email protected])
# 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的代码不?我正缺少个编译器。
不为失败找理由,要为成功找方法
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: avrdude实现8051芯片烧录

#2

帖子 eexpress » 2009-12-31 22:35

烧录的,只和硬件设备有关吧。
你这JTAG?
● 鸣学
头像
soloflight
帖子: 6
注册时间: 2009-12-31 22:05

Re: avrdude实现8051芯片烧录

#3

帖子 soloflight » 2009-12-31 22:43

JTAG?不知道是什么,我刚学点8051一直都在用at89s52芯片,你知道有那些编译器可以编译c51?gcc-avr可以写51的程序不?
不为失败找理由,要为成功找方法
头像
eexpress
帖子: 58428
注册时间: 2005-08-14 21:55
来自: 长沙

Re: avrdude实现8051芯片烧录

#4

帖子 eexpress » 2009-12-31 23:12

只有一个不好的sdcc编译啊。
● 鸣学
头像
soloflight
帖子: 6
注册时间: 2009-12-31 22:05

Re: avrdude实现8051芯片烧录

#5

帖子 soloflight » 2009-12-31 23:52

除了sdcc就没有了?
不为失败找理由,要为成功找方法
头像
soloflight
帖子: 6
注册时间: 2009-12-31 22:05

Re: avrdude实现8051芯片烧录

#6

帖子 soloflight » 2010-02-07 1:36

现在又发现还有一个asem51也很好用,如果我用usb转串口有支持的烧录器不?
不为失败找理由,要为成功找方法
oxangen
帖子: 64
注册时间: 2010-03-09 14:02

Re: avrdude实现8051芯片烧录

#7

帖子 oxangen » 2010-04-28 22:14

烧进52芯片比烧avr要慢,请问楼主上面的文件是不是有些数据可以改小一点?
ThinkPad T60 with ubuntu 10.10 and windows xp sp3
头像
tonghuix
帖子: 355
注册时间: 2010-10-08 0:55

Re: avrdude实现8051芯片烧录

#8

帖子 tonghuix » 2010-11-22 23:28

不错,收藏一下
如果可以的话,理论上可以把这个东西改造成万能烧写器
/***
* @tonghuix 佟辉 Tong Hui
* @brief 启智开源 编码自由
* @brief Open Source Open Mind, Coding for free!
* @website: https://tonghuix.io
* @weibo http://weibo.com/234826309
* @Twitter http://twitter.com/tonghuix
* @G+ http://gplus.to/tonghuix
*/
头像
zhaoqingyu51
帖子: 120
注册时间: 2011-10-02 21:06

Re: avrdude实现8051芯片烧录

#9

帖子 zhaoqingyu51 » 2011-10-26 12:46

soloflight 写了:现在又发现还有一个asem51也很好用,如果我用usb转串口有支持的烧录器不?

可是我的有点问题啊。。。
附件
Screenshot.png
ashf
帖子: 23
注册时间: 2009-01-02 21:41

Re: avrdude实现8051芯片烧录

#10

帖子 ashf » 2012-04-23 0:19

这个配置文件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.
回复