I am working on lpc 1768 on keil version 5, after building the code when i go to debug using simulation option and run the code(using F5) the stop watch t1 which is in left bottom corner of debug window does not run continuously.
I have to hit F5 every time and the code gets stuck at
while (!(LPC_SC->PLL0STAT & (1<<26)));/* Wait for PLOCK0
above line which is in system_LPC17xx.c
Please help me in this situation.
do i need to set clock?
>>do i need to set clock? Most real-world synchronous logic expects you to supply one. What does the part's Reference Manual suggest?
Have you tried enabling the clock? Does the code work on real hardware? Do the peripheral views in the debugger suggest that registers are in a usable state?
I don't have real hardware that's why i am using simulation option for debugging in keil.
Following error in shown in command window *** error 65: access violation at 0x400FC088 : no 'read' permission
Error 65 -> This hardware element is *not* supported by the simulator because it is not a core CPU function, ie peripheral to it.
So, i need to select a board that has LPC1768 controller, then it will not show any error?
You will not see "Error 65" on real hardware, if things aren't initialized correctly your code will simply not function properly.
The compiler can tell you if you have syntax errors, it can not tell you if the code is functionally correct. For that you'll need to debug and review technical documentation thoroughly.
-> So, i need to select a board that has LPC1768 controller,
No. At the moment, you should comment out those lines.
For real hardware, simple testing would not need PLL. You can run firmware from internal oscillator.
For simulator, PLL never locks. The address of PLL0STAT is 0x400FC088, bit-26 means lock or not. I believe you don't need to simulate PLL, just comment out those PLL lines.
I tried commenting the PLL portion. the code runs to main . I have just initialized UART register in main.
No changes in register takes place while debugging.