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.
While trying to get fimiliar with the new XE167, I'm already stuck at the very beginning ... I took the Toggle_Pin example that comes along with the Infineon Developer Kit. The original program runs fine. Next, I tried to use GPT12 to control the LEDs. But when adding the following code (to enable the GPT module)
GPT12E_KSCCFG = 0x0003; dummy = GPT12E_KSCCFG;
I get the following message after downloading the binary
Erasing... Erase Done. Programming Done. Verify OK. Device is locked DAS port is in wrong state Application running ...
and the program isn't running but is frequently resetting. Any ideas? Thanks!
My problem is solved. Before accessing the (protected) KSCCFG registers, the security level must be changed. I used the code snippet generated by DAvE to unlock the registers:
void MAIN_vUnlockProtecReg(void) { uword uwPASSWORD; SCU_SLC = 0xAAAA; // command 0 SCU_SLC = 0x5554; // command 1 uwPASSWORD = SCU_SLS & 0x00FF; uwPASSWORD = (~uwPASSWORD) & 0x00FF; SCU_SLC = 0x9600 | uwPASSWORD; // command 2 SCU_SLC = 0x0000; // command 3 } // End of function MAIN_vUnlockProtecReg