- Calibrations
- Calibration File Offsets Explained
This is a quick explanation of how to figure out the different offsets needed for burning a cal to a chip, and why that's different from the offset used by D-Cal or CHeM.
The CPU in the SMEC or SBEC can access up to 64k of memory - total. The bottom 32k is mostly reserved for system memory - RAM, and input/ouput ports. The top 32k is used for the program and data storage (the EPROM). But, the entry point for the code is at the END of the memory space (the interrupt vectors). The #1 rule is that the very last byte of your file must match up with the very last byte of the memory space. The hardware ensures that the last byte of the chip itself is always at the end of the CPU's address space.
So, if you have a 32k chip and a 32k .bin, you need no offset when you burn as the file fills the chip and the end of the file lines up with the end of the chip.
But, if you burn a 16k .bin to a 32k chip - you need an offset. Half of the space. Which turns out to be 16k or 0x4000 (4000 hex). This makes sure that the end of the file lines up with the end of the chip.
If you burn a 32k file to a 64k chip - you also need an offset. Again, half of the memory space, or 32k or 0x8000 (8000 hex).
Finally, burning a 16k file to a 64k chip you need an offset that is 3/4 of the space - 48k or 0xC000.
For reference, I made this chart to help illustrate what I'm talking about.
The CPU in the SMEC or SBEC can access up to 64k of memory - total. The bottom 32k is mostly reserved for system memory - RAM, and input/ouput ports. The top 32k is used for the program and data storage (the EPROM). But, the entry point for the code is at the END of the memory space (the interrupt vectors). The #1 rule is that the very last byte of your file must match up with the very last byte of the memory space. The hardware ensures that the last byte of the chip itself is always at the end of the CPU's address space.
So, if you have a 32k chip and a 32k .bin, you need no offset when you burn as the file fills the chip and the end of the file lines up with the end of the chip.
But, if you burn a 16k .bin to a 32k chip - you need an offset. Half of the space. Which turns out to be 16k or 0x4000 (4000 hex). This makes sure that the end of the file lines up with the end of the chip.
If you burn a 32k file to a 64k chip - you also need an offset. Again, half of the memory space, or 32k or 0x8000 (8000 hex).
Finally, burning a 16k file to a 64k chip you need an offset that is 3/4 of the space - 48k or 0xC000.
For reference, I made this chart to help illustrate what I'm talking about.
This page has been seen 2,484 times.
-
-
Last updated by on
-