Hello priyanto,
I assume that your "raw data bytes" are a binary image of the contents of (flash/PROM/RAM) memory. A problem you may be encountering is that the first byte of the data would be assumed to commence at address 0. However, this is probably not what you require - you probably need to offset the data to start at a specific non-zero location. The simple utilities that you mention may not have the capability to provide an offset for the data, required for the S19 file.
Also note that the S19 format (and also the Intel hex format) represent all data as printable ASCII characters. So the byte value 0x01 is represented by the character sequence "01" (0x30, 0x31). However, when an S19 file is loaded, each byte value will be decoded from its two-character sequence. There may be some confusion about this.
Regards,
Mac
PS
I have subsequently done some quick tests with BIN2S19 and BIN2MOT utilities. Both seem to have the ability to provide data offset. I had no problem with BIN2S19, and it produced the expected result with the command line "BIN2S19 file.bin offset", with the offset expressed in hex.
However, I could not get BIN2MOT to produce the correct offset - but perhaps I did not correctly set up the command line options.
Message Edited by bigmac on 2006-06-22 04:22 PM
Hi Mac,
Now I use the binary file format instead of hex file, and run BIN2S19.EXE again. Then I use CW hiwave to download the program into the flash, and everything works great. The problem is that everytime I download the code, CW always asks me to erase the FLASH, so I have no choice. Like David said, I have to download the program first, then program the data into the blank portion of the flash. BTW, we have 32K bytes of data. It will occupy half of the flash of HC9S08GT60.
During our production, we will have thousands of tags each has HC9S08GT60 microcontroller. I'm still trying to find out the best way to do this since later on the manufacturing guys will do the job. Furthermore, each tag has its own unique ID preprogrammed into the flash of each microcontroller. Do you know the best way or any tool for automating the process in the production ?
Appreciate any helpful responses.
-priyanto.
Hi Irob,
Thanks for your reply. I need a program to convert bin or hex to S19 Motorola format so that 'hiwave' program can download it into the flash. Hiwave expects the S19 Motorola format. I have 16K bytes of raw data that needs to be burnt into the flash separately from my code. BTW, I use HC9S08 and CodeWarrior 5 IDE. BINCVT is converting into binary as far as I know.
Regards,
priyanto.
Hi,
Failing everything else a bit of search/replace in a good editor should yield you source code that can then be assembled into a S19.
Replace ,0x with /nDB $ in your data file example, then stick an ORG statement on top and off you go!
Regards David
Message Edited by peg on 2006-06-22 09:01 AM