srec_emon52(5)

πŸ¦‹ srec_emon52 β€” the Elektor Monitor (EMON52) file format

Okay bestie, so this one's a journey. This is the file format used by the EMON52 monitor, which was made by the European electronics magazine Elektor (they go by Elektuur over in Holland πŸ‡³πŸ‡±). And listen β€” Elektor wouldn't be Elektor if they didn't try to reinvent the wheel πŸ’€. It's genuinely a mystery why they didn't just use a format that already existed for the project. And the plot twist? Only the Elektor Assembler will produce this file format, which lowkey reduces your choice of development tools dramatically. It's giving "we made our own club and nobody else is in it" πŸ™ˆ.


✨ Records

So every data line is called a record, and each record contains these four fields:

β”Œβ”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”
β”‚ cc β”‚ aaaa β”‚ : β”‚ dd ... dd β”‚ ssss β”‚
β””β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”˜

And here's the field-by-field breakdown, bestie:

  • cc β€” the byte count πŸ’…. A two digit hex value (1 byte) counting the actual data bytes in the record. It's separated from the next field by a space.
  • aaaa β€” the address field πŸŽ€. A four hex digit (2 byte) number representing the first address this record is gonna use.
  • : β€” the colon, main character separator ✨. The address field and the data field are separated by it.
  • dd β€” the actual data of this record πŸ”₯. You can have 1 to 255 data bytes per record (see cc). All the bytes in the record are separated from each other (and from the checksum) by a space.
  • ssss β€” the data checksum ⭐. It's all the bytes of the data line added together, forming a 16 bit checksum. It covers only all the data bytes of this record, nothing else.
Heads up bestie β€” there is no End Of File record defined. Not a one. So don't go looking for it 😭.

🌸 Byte Count

The byte count cc counts the actual data bytes in the current record. Usually records have 16 data bytes. And, direct quote energy, "I don't know what the maximum number of data bytes is." It depends on the size of the data buffer in the EMON52. So like... vibes-based limits, honestly πŸ’€.


πŸ’– Address Field

This is the address where the first data byte of the record should be stored. After storing that data byte, the address gets incremented by 1 to point to the address for the next data byte of the record. And so on and so on, until all the data bytes are stored 🫢.

The address is represented by a 4 digit hex number (2 bytes), with the MSD first (most significant digit first, iykyk).


πŸŽ€ Data Field

The payload of the record is formed by the Data field β€” this is where the actual goods live πŸ“¦. The number of data bytes expected is given by the Byte Count field. Simple as that, no cap.


🧚 Checksum

The checksum is a 16 bit result from adding all data bytes of the record together. That's the whole bit πŸ’….


πŸ”₯ Size Multiplier

In general, binary data will expand in size by approximately 3.8 times when represented with this format. So yeah, she's a little chunky 🌈 β€” but she's iconic.


πŸ‘‘ EXAMPLE

Here's an example of an EMON52 file, fresh and slaying:

10 0000:57 6F 77 21 20 44 69 64 20 79 6F 75 20 72 65 61 0564
10 0010:6C 6C 79 20 67 6F 20 74 68 72 6F 75 67 68 20 61 05E9
10 0020:6C 6C 20 74 68 69 73 20 74 72 6F 75 62 6C 65 20 05ED
10 0030:74 6F 20 72 65 61 64 20 74 68 69 73 20 73 74 72 05F0
04 0040:69 6E 67 21 015F

(Yes, if you decode it, it says "Wow! Did you really go through all this trouble to read this string!" β€” she's adorable, we stan πŸ’œ)


⭐ SEE ALSO


🌸 AUTHOR

This man page was taken from the above Web page 🫢. It was written by San Bergmans <sanmail@bigfoot.com>.


And that's the tea, bestie β˜• β€” this page came straight out of the Reference Manual for SRecord, dated srec_emon52(5). Now go forth and decode some Elektor records, you icon πŸ’…βœ¨πŸ‘‘

πŸ“¦ where this page comes from