查看: 15886|回复: 14

[其他] S19 文件格式说明

[复制链接]

该用户从未签到

8

主题

39

帖子

0

注册会员

Rank: 2

积分
121
最后登录
1970-1-1
发表于 2008-7-25 12:43:04 | 显示全部楼层 |阅读模式
补充一点:S0开头的是说明信息,如原文件的路径文件名等,并不下载到存储器中。 
 
S19 file records are a text representation of Hexadecimal coded binary
data. All data uses only ASCII characters, so the format is portable across
virtually all computer platforms. The S19 format, described here, is for
eight bit data.

(The '$' will be used throughout to indicate a hexadecimal value.)

Each line in a S19 file is called a 'record'. Records always begin with a
the letter 'S', followed by a '1' if the record contains data, or a '9' if this
is the last record in the file.

The next byte represents the number of bytes in this record, including the
starting address, data bytes, and the checksum.

The next pair of numbers represent the 16-bit starting address of the data in
the record. This is the absolute location in the EPROM.

Following the address are the hex representations of the data to be stored.

The last byte is an eight-bit one's-complement checksum of all of the bytes in
the record (not including the S1). Note that this value is derived from the
binary values of the bytes, not the ASCII representation.

A standard CR/LF pair (carriage return/linefeed, $0D $0A) terminates each line.


This a sample Motorola S19 record.

S1130170707172737475767778797A7B7C7D7E7F03

Broken down, it looks as follows:

S               - Indicates that this is Motorola

1               - 1 means this is a data record

13              - Number of bytes to follow = $13, or 19 decimal. This number
                  can be thought of as the number of data bytes plus three.
                  Therefore there will be 16 data bytes in the record.

0170            - Starting address in the EPROM for this record.

70              - These are the data bytes (in hex) - 16 of them as noted above
71                The first byte ($70) will be stored at $0170, with the
72                remaining bytes following in sequence.
73
74
75
76
77
78
79
7A
7B
7C
7D
7E
7F

03              - This is the checksum. If you add all of the successive bytes
                  (note that the address is treated as two individual bytes) the
                  result is $7FC. Truncating this to eight bits yields $FC. The
                  one's complement of $FC is $06. (This may be derived by
                  subtracting $FC from $FF, or by inverting the bits.)

(CR/LF)         - End of this record -- I think the linefeed may be optional.

The use of the starting address in each record makes it possible to store data
in non-contiguous areas of the EPROM. Each line of data is therefore entirely
self-contained. This is useful when areas of the EPROM are unused, as no space
in the S19 file need be wasted by representation of blank data. It is
perfectly possible, albeit not recommended, to scramble all of the record lines
in a S19 file and still end up with a correct EPROM image.

The end record (end of file) is almost the same:

S9030000FC

S               - Indicates that this is Motorola

9               - 9 means this is the end record

03              - Number of bytes - should be three, as no data bytes will be in
                  this record.

0000            - Address, usually zero.

                - Zero data bytes here (obviously)

FC              - The checksum, calculated as above.


You may also see records starting with S0 - I believe these are called comment
records. They do not contain any data that will be stored in the EPROM.

I hope this helps.
                                Sanjaya Vatuk           11/4/96
                                sanjaya@concentric.net
我知道答案 目前已有14人回答
回复

使用道具 举报

该用户从未签到

0

主题

4

帖子

0

新手上路

Rank: 1

积分
24
最后登录
1970-1-1
发表于 2008-7-30 13:13:24 | 显示全部楼层

RE:S19 文件格式说明

good~~~~~~~~~~~~

该用户从未签到

0

主题

35

帖子

0

注册会员

Rank: 2

积分
111
最后登录
1970-1-1
发表于 2008-8-1 14:46:50 | 显示全部楼层

RE:S19 文件格式说明

有没有.08p文件地说明阿

该用户从未签到

8

主题

39

帖子

0

注册会员

Rank: 2

积分
121
最后登录
1970-1-1
 楼主| 发表于 2008-8-5 12:31:55 | 显示全部楼层

RE:S19 文件格式说明

观察.08p文件可以看出其中包含芯片的基本信息如flash大小,地址范围等。应该还包含一段通过BDM向flash下载程序的代码(从RAM里执行)。是P&E公司开发的。其内容和含义不对外公开。

该用户从未签到

0

主题

35

帖子

0

注册会员

Rank: 2

积分
111
最后登录
1970-1-1
发表于 2008-8-5 23:25:54 | 显示全部楼层

RE:S19 文件格式说明

将什么什么下载到RAM里面,这个功能我可以做到,但是如何让RAM里面的程序RUN起来呢?
08p的开头有些说明,我能理解些大概,但是后面的一串代码,代表的是什么呢?好像是些什么算法文件。但是没有地方能说得确切些。大哥知道不?
指点一二

该用户从未签到

8

主题

39

帖子

0

注册会员

Rank: 2

积分
121
最后登录
1970-1-1
 楼主| 发表于 2008-8-7 13:26:28 | 显示全部楼层

RE:S19 文件格式说明

想执行RAM里的代码,当然是想办法把PC写成想要的地址了。老兄在搞HC08还是S08?HC08好像可以在monitor mode发一个rti命令。那就先把相应的堆栈写成想要的地址,然后rti。S08可以通过BDM直接写PC然后发个“GO”命令。研究.08p做什么?想自己做programmer?

该用户从未签到

0

主题

35

帖子

0

注册会员

Rank: 2

积分
111
最后登录
1970-1-1
发表于 2008-8-7 15:42:58 | 显示全部楼层

RE:S19 文件格式说明

嘿嘿,大哥太聪明了。我就是想做PROGRAMMER ONLINE。进入MONITOR还需要硬件上支持(如在某某管脚加某种电压等)如果做好这个PRO,嘿嘿,那烧写即可在线完成。
希望与大家一起完成,共同学习

该用户从未签到

0

主题

1

帖子

0

新手上路

Rank: 1

积分
19
最后登录
1970-1-1
发表于 2008-8-8 13:54:54 | 显示全部楼层

RE:S19 文件格式说明

楼上的,我也是在做PROGRAMMER ONLINE,你现在做的怎么样了?我的qq是170469401,加我QQ大家一起讨论下!!

该用户从未签到

8

主题

39

帖子

0

注册会员

Rank: 2

积分
121
最后登录
1970-1-1
 楼主| 发表于 2008-8-8 19:01:35 | 显示全部楼层

RE:S19 文件格式说明

PROGRAMMER ONLINE是什么项目?有奖金吗?呵呵。 我们用908GR8,JL8,QY4做产品时就是先焊到板子上再写程序的,设计硬件时要考虑编程时要用到的管脚,比如用于键盘等。串口编程器可以自己做,我这有SCH和PCB。但还是用的P&E的软件。自己做软件也不是不行,不过新项目还是转到S08吧,S08是HC08的换代产品。

该用户从未签到

0

主题

35

帖子

0

注册会员

Rank: 2

积分
111
最后登录
1970-1-1
发表于 2008-8-9 00:42:40 | 显示全部楼层

RE:S19 文件格式说明

我的开始一段时间了,了解了如何做,但是还没有具体编码,调试。
楼主,我做的不是什么项目,也没有项目,不过做出来还算是一个技能吧。能够在公司里面得到重视与应用哦。嘿嘿,如果做出来,可以实现串口(k线)在线烧写,CAN线烧写等一些只需要在通讯协议进行通讯,即可烧写程序,无需每次将电路板拆下来,减少开发时间。
您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /3 下一条

Archiver|手机版|小黑屋|恩智浦技术社区

GMT+8, 2025-7-18 17:19 , Processed in 0.109640 second(s), 29 queries , MemCache On.

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.

快速回复 返回顶部 返回列表