Hello,
I'm using a NXP LPC1768 Cortex-M3 controller with KEIL MDK-ARM and uLink2-Debugger.
When I start my application from a higher address than 0 (VTOR > 0) the ADC gives back strange values. This is due to the ADC Trim register ADTRM.
During debugging: When I start my application from address 0x00 (VTOR=0x00), the ADTRM register is 0xF00. But when I start it from address 0x2000 (VTOR=0x2000), the ADTRM register is set to 0x000. The other application works. I can set ADTRM manually to 0xF00 (although it is not allowed by datasheet), then it works.
Can you explain me that behavior? When is ADTRM set during boot code? What can I do, to prevent this ADC malfunction?
Thank you for an answer,
DW.
Hi,
yes, the debugger should reset the controller. In the debugger settings the address range is set to 00002000H - 0007FFFFH and I am using an INI file:
SP=_RDWORD(0x2000); // Setup Stack Pointer PC=_RDWORD(0x2004); // Setup Program Counter _WDWORD(0xE000ED08, 0x2000); // Setup Vector Table Offset Register
The bootloader is at 0x00, but it's another project and I just want to debug the real application at 0x2000 (what generally works).
I would like to get an understanding of the things that happen at start-up and prevent other side-effects.