Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help With Motorola S19 Format? Help!

Status
Not open for further replies.

ravi94

Newbie level 5
Joined
Feb 26, 2011
Messages
10
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,281
Activity points
1,376
Hi there
...Im new here so be nice :)

Im just trying to get as much help as possible regarding the Motorola S19 format. I have set up a very complex fire alarm in my home which uses sensors that can "speak" to you. Essentially a voice alarm system. Im only 16 so Im doing well!

Basically what I am trying to do is change the speech messages which the device can play once the fire alarm is activated. I have bought the programmer and asked the company if they can convert a couple of sample messages. They did that and the custom messages play through the sounders perfect. Only now I can use the system for other alarm purposes such as Carbon Monoxide or intruder alarm. You get the idea!

I want to know how they did it but im not getting any replies to the many emails ive sent to the company themselves which is annoying! Now im no software developer so what I want to figure out how to do is how to convert an audio file into the motorola s19 format?

I can email/attach the sample S19 file I was given, is there any way you could help me figure out how they converted audio into this s19 format and maybe point me in the right direction as to how I can convert other audio files into this format?

Will the s19 file they supplied have any information about the actual chip that is used? It is definitely a flash chip but thats all I know!

I do hope you could help me. Thankyou very much for reading
 

Motorola S19 is simply a commonly used format to store binary data, e.g. a processor firmware image. The manufacturer can have either embedded the voice data into the program code or used separate files with voice data only. In any case, you have to know the involved audio coding and the data structure (e.g. start and length marking for individual sound samples). It may be a simple *.WAV format, as used for the sounds played by the Windows OS on your computer, but also something very different.
 
  • Like
Reactions: ravi94

    ravi94

    Points: 2
    Helpful Answer Positive Rating
In any case, you have to know the involved audio coding and the data structure (e.g. start and length marking for individual sound samples). It may be a simple *.WAV format, as used for the sounds played by the Windows OS on your computer, but also something very different.

Hello and thankyou for your reply!

I did try asking the technical dept at the company and I know that they asked for .WAV messages...

When you say "start and length marking for invidual sound..." do you mean the length of the soundclip (i.e 13 seconds) or something else?
To me, the guides explaining s19 are just random letters and numbers. Is there no easy/quick method to insert a .WAV file and it to just be somehow converted into the s19 format?!

...As you can see I have no idea! Any help is greatly appreciated
 

The most simple variant would be, that the device is directly storing and playing *.wav files. But you didn't exactly tell about the S19 files you have. Is it one file containing voice data only, or several S19 files, one for each sound clip? Or one file with the voice data assembled into processor firmware?

S19 data can be converted to binary data and vice versa with simple converter programs. If you have the original *.wav files, you are possibly able to identify the place of sound data in the S19 files and can replace it with others. But this depends very much on how they did it.
 

The most simple variant would be, that the device is directly storing and playing *.wav files. But you didn't exactly tell about the S19 files you have. Is it one file containing voice data only, or several S19 files, one for each sound clip? Or one file with the voice data assembled into processor firmware?

S19 data can be converted to binary data and vice versa with simple converter programs. If you have the original *.wav files, you are possibly able to identify the place of sound data in the S19 files and can replace it with others. But this depends very much on how they did it.

I can send you the file if you like? It only has 1 message in the s19 file I have... I don't know if its another file inside an s19 file? Is there any way you could find out for me? Unless I can do it?

Can you recommend a program that will decompile the s19 file and how I can find the whereabouts of the WAV message?

I feel like im getting somewhere now, thankyou for your help! How can i send you the s19 file? Via email? I will try PM you now...
 

A brief explanation of the Motorola S19 file format.

Motorola 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 Motorola 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 $03. (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 Motorola 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 Motorola 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.
 
Last edited:

Your problem could be easily solved if you write some simple PC application to "inject" the code. The Moto S19 of Intel HEX format define the values in the memory. So if in your code you reserve some area you can inject there any file or any data you want. Normally in the C code you define your reserved area as (for IAR ATmel)
__root __flash uit8_t MY_MESSAGE[10000] @ RESERVED_ADDRESS;
 

sorry its been a while, ive been busy with school etc..

Thankyou all for your replies, especially with the detailed description of s19!

I have spoken to a member on here and he is saying that the file I have isnt actually an s19...

Is there any programme out there or person should I say that could figure out what format is actually inside?!

I am using the MTTTY terminal emulator software to connect my programming unit to my PC, this software ONLY allows s19 files to be transmitted and nothing else, My thinking is that they have just renamed a different file format to "s19" so it can be transmitted.


Again, im only 16 and have very little knowledge of these formats and flash memory in general!

If anyone else can help further please do so, I cannot tell you how grateful I will be :)
 

I realized that there is one possible way to mix S19 files exactly in the way you wanted:
1. You load your initial S19 file - it creates an image of the data in the memory
2. You load S19 file which covers only a portion of the memory (for example from address $1000 to $1800 only). During the compilation of this file is importnat to uncheck "Fill unused area" if exists. You need to generate code only for this area. In case the code for unused area is generated you can delete it manually in some text editor
 

Again, I wish I understood what you meant!

What am I loading the s19 file into?! Sorry I probably seem really dumb to you wizzes!!! Im comfortable with using notepad to edit files? Just if I knew what to edit it with is the question!

I just wish it was as simple as me loading my audio files into a converter and me pressing 1 button to convert them into the s19 format!!

luben111 I will PM you :)
 

Hello again everyone

I have been informed that the structure of my s19 file is not very straight forward and apparently it needs decrypting/decoding to figure out the table or something? A very kind user said he has a programme that he will re-configure to convert my wav messages to s19 just as long as he has the structure. He doesnt have time at the moment.

I would try decrypt the file myself but I haven't a clue where to start. Would any of you guys/girls be willing to help me decode the file and find the structure of it? Paypal donations are also available :)
 

Why don't you just zip it up and post the file here?
Then a lot more people could take a look and see if they can figure it out.

Include the wav file that it encrypts.
 

Why don't you just zip it up and post the file here?
Then a lot more people could take a look and see if they can figure it out.

Include the wav file that it encrypts.

I didn't realise that I was allowed to do that...!

I have, as you said, put the s19 image file in a folder and the relevant WAV files associated with it.

The actual fire alarm also produces a "popping" sound which is called a monitor sound. I am not sure if this is also put into the s19 file?

I will be so grateful if somebody would help me figure out the structure so I can get the program made
 

Attachments

  • S19 Files & WAV messages.rar
    2.3 MB · Views: 110

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top