阅读:1116回复:12
有用过w78e58b的么?怎么才能从串口下载程序呀? 50求救!
我这有个例子,可是我总是弄不明白,哪位大虾能简单介绍一下,串口的发的程序怎么能合理的下载到rom中。
这里人多,大家帮忙看看吧。 :( |
|
沙发#
发布于:2003-09-24 10:51
顶一下了。
说说数据该怎么处理就好。 :D |
|
板凳#
发布于:2003-09-24 11:22
还得顶。放这一会就下去了。
我知道应该怎么进入写的状态,不明白的是,从串口发的数据是不是不能直接就放到rom里。 应该怎么处理呢? 地址改怎么办。 我看datasheet了,没看明白。 :( 偶汇编都忘的差不多啦。。。。。 |
|
地板#
发布于:2003-09-24 11:38
我以前做DSP没有开发工具,是在DSP内部存一引导程序,由这程序来引导串口过来的程序,MCU长时间没用了,不知是能用你这!!!!!
|
|
|
地下室#
发布于:2003-09-24 11:46
我以前做DSP没有开发工具,是在DSP内部存一引导程序,由这程序来引导串口过来的程序,MCU长时间没用了,不知是能用你这!!!!! 引导程序? 思路是什么样的?说来看看。 :D |
|
5楼#
发布于:2003-09-24 14:01
没用过这东东,帮你顶一下。
记得DSP一般会有一个load程序,原来(很久以前了,不知现在还是不是这样)是放在EPROM里的,先运行这个程序,在程序里等串口数据, 当串口数据收完后直接执行。 |
|
|
6楼#
发布于:2003-09-24 14:04
没用过这东东,帮你顶一下。 现在向206还是这样的。 |
|
7楼#
发布于:2003-09-24 14:12
好久没用了,
在下载程序的时候好像要将其中的pin设为一个确定的状态,然后就可以象传送资料一样处理就是了. 好像没说,n9没用了,现在做软件了 |
|
|
8楼#
发布于:2003-09-24 15:42
唉, 郁闷, 这有个例子,厂家说好使,可我这就是下不了。 datasheet里也有没看懂。
潜水一天,研究书去啦。 |
|
9楼#
发布于:2003-09-24 15:44
谢谢各位,帐先结了,如果有人解决了,另放分50。
|
|
10楼#
发布于:2003-09-24 16:50
pin是用来设置模式的,mcu里有一段控制代码,通过SCI将程序写入RAM,等程序下载完毕再传入ROM,不知道我的理解对不对。 :D
|
|
|
11楼#
发布于:2003-09-24 17:50
不是很懂pin。 老实说,他们说的我都不懂。
我找到问题的根本了,我不清楚.hex文件的格式,在网上没找到,手头上也没有书,各位谁知道,把文档贴上来,偶会实现另放50分的。 不要水分也可以呀。 告诉我,我去别的地方另开一个帖子,放分。 这好象对老鸟来说不难。 找到根源,结束潜水(可憋死我了)。 :D |
|
12楼#
发布于:2003-09-24 17:54
哈哈, 让偶找到了。 没分放啦。
---------------------------------------------------- QUESTION What is the Intel HEX file format? ANSWER The Intel HEX file is an ASCII text file with lines of text that follow the Intel HEX file format. Each line in an Intel HEX file contains one HEX record. These records are made up of hexadecimal numbers that represent machine language code and/or constant data. Intel HEX files are often used to transfer the program and data that would be stored in a ROM or EPROM. Most EPROM programmers or emulators can use Intel HEX files. Record Format An Intel HEX file is composed of any number of HEX records. Each record is made up of five fields that are arranged in the following format: :llaaaatt[dd...]cc Each group of letters corresponds to a different field, and each letter represents a single hexadecimal digit. Each field is composed of at least two hexadecimal digits-which make up a byte-as described below: : is the colon that starts every Intel HEX record. ll is the record-length field that represents the number of data bytes (dd) in the record. aaaa is the address field that represents the starting address for subsequent data in the record. tt is the field that represents the HEX record type, which may be one of the following: 00 - data record 01 - end-of-file record 02 - extended segment address record 04 - extended linear address record dd is a data field that represents one byte of data. A record may have multiple data bytes. The number of data bytes in the record must match the number specified by the ll field. cc is the checksum field that represents the checksum of the record. The checksum is calculated by summing the values of all hexadecimal digit pairs in the record modulo 256 and taking the two\'s complement. Data Records The Intel HEX file is made up of any number of data records that are terminated with a carriage return and a linefeed. Data records appear as follows: :10246200464C5549442050524F46494C4500464C33 where: 10 is the number of data bytes in the record. 2462 is the address where the data are to be located in memory. 00 is the record type 00 (a data record). 464C...464C is the data. 33 is the checksum of the record. Extended Linear Address Records (HEX386) Extended linear address records are also known as 32-bit address records and HEX386 records. These records contain the upper 16 bits (bits 16-31) of the data address. The extended linear address record always has two data bytes and appears as follows: :02000004FFFFFC where: 02 is the number of data bytes in the record. 0000 is the address field. For the extended linear address record, this field is always 0000. 04 is the record type 04 (an extended linear address record). FFFF is the upper 16 bits of the address. FC is the checksum of the record and is calculated as 01h + NOT(02h + 00h + 00h + 04h + FFh + FFh). When an extended linear address record is read, the extended linear address stored in the data field is saved and is applied to subsequent records read from the Intel HEX file. The linear address remains effective until changed by another extended address record. The absolute-memory address of a data record is obtained by adding the address field in the record to the shifted address data from the extended linear address record. The following example illustrates this process.. Address from the data record\'s address field 2462 Extended linear address record data field FFFF -------- Absolute-memory address FFFF2462 Extended Segment Address Records (HEX86) Extended segment address records-also known as HEX86 records-contain bits 4-19 of the data address segment. The extended segment address record always has two data bytes and appears as follows: :020000021200EA where: 02 is the number of data bytes in the record. 0000 is the address field. For the extended segment address record, this field is always 0000. 02 is the record type 02 (an extended segment address record). 1200 is the segment of the address. EA is the checksum of the record and is calculated as 01h + NOT(02h + 00h + 00h + 02h + 12h + 00h). When an extended segment address record is read, the extended segment address stored in the data field is saved and is applied to subsequent records read from the Intel HEX file. The segment address remains effective until changed by another extended address record. The absolute-memory address of a data record is obtained by adding the address field in the record to the shifted-address data from the extended segment address record. The following example illustrates this process. Address from the data record\'s address field 2462 Extended segment address record data field 1200 -------- Absolute memory address 00014462 End-of-File (EOF) Records An Intel HEX file must end with an end-of-file (EOF) record. This record must have the value 01 in the record type field. An EOF record always appears as follows: :00000001FF where: 00 is the number of data bytes in the record. 0000 is the address where the data are to be located in memory. The address in end-of-file records is meaningless and is ignored. An address of 0000h is typical. 01 is the record type 01 (an end-of-file record). FF is the checksum of the record and is calculated as 01h + NOT(00h + 00h + 00h + 01h). Example Intel HEX File Following is an example of a complete Intel HEX file: :10001300AC12AD13AE10AF1112002F8E0E8F0F2244 :10000300E50B250DF509E50A350CF5081200132259 :03000000020023D8 :0C002300787FE4F6D8FD7581130200031D :10002F00EFF88DF0A4FFEDC5F0CEA42EFEEC88F016 :04003F00A42EFE22CB :00000001FF Hex 文件的INTEL 格式:是Intel 公司提出的按地址排列的数据信息,据宽度为字节,有数 据使用16 进制数字表示. 这是一个例子: :10008000AF5F67F0602703E0322CFA92007780C361 :1000900089001C6B7EA7CA9200FE10D2AA00477D81 :0B00A00080FA92006F3600C3A00076CB :00000001FF 第一行,\":\"号表明记录的开始. 后面的两个字符表明记录的长度,里是10h. 后面的四个字 符给出调入的地址,里是0080h. 后面的两个字符表明记录的类型; 0 数据记 录 1 记录文件结 束 2 扩展段地址记 录 3 开始段地址记 录 4 扩展线性地址记 录 5 开始线性地址记录 后面则是真正的数据记录, 最后两位是校验和检查,加上前面所有的数据和为0. 最后一行特殊,是写成这个样子. 扩展Intel Hex 的格式(大1M): 由于普通的Intel 的Hex 记录文件只能记录64K 的地址范围, 所以大于64K 的地址数据要靠扩展Intel Hex 格式的文件来记录.于扩展形式Hex 文件,每 一个64K 段的开始加上扩展的段地址规定,面的数据地址均在这个段内,非出现新的段地址 定义. 一个段地 址 定义的格式如下: 起始 符 长 度 起始地 址 扩展段标 示 扩展段序 号 无 用 累加和 : 02 0000 02 3000 EC 段地址的标识符是第四组数据02,示扩展地址段的定义,后面的以为HEX 数表示段的数目, 上面的定义为3,示段地址是3,以下面的数据地址是3 + XX(XX 是64K 段内的地址) :D |
|