We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I need to be able to hold two applications on-chip at a time so I can choose which one to run (using a code based reset giving a start vector)
T89C51AC2
The default one will be compiled for the 'standard' memory location (0x0000?), and the second one, that will be flashed into memory via IAP at 0x4000.
My initial thoughts to compile a hex file for this upper location (in uVision 3) would be to change the project settings:
C51 Tab : (checked) Interrupt Vectors At Address: 0x4000 BL51 Locate Tab : (Un-Checked) Use Memory Layout from Target Dialog BL51 Locate Tab : Code 0x4000
This 'seems' to produce a hex file located at 0x4000 (although I am not yet ready to test its operation)
However, this hex file contains a line that writes to memory location 0x0000. Is this normal? This would overwrite data placed there by the lower memory hex file?!
Or, am I approaching this the wrong way, because something doesn't feel right here.
If the IVT was stored somewhere else, wouldn't it show up in the Hex file?
It should be at the address you specified in the Target/C51 dialog. There's nothing that's immediately obious about it, though - it merely contains a jump to the actual interrupt service routine.
Also, does it make any difference that I'm coding it in C rather than assembler?
Unfortunately, it does. The C compiler does not allow you to put any real code in the 8 byte space reserved for each interrupt vector - it only puts a jump to the actual ISR in there. If you want direct access to those 8 bytes, you will have to write the table in assembly.