This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Simulation for LPC1227

Good day!
I try debug in Keil simulator simple blinking program for LPC1227.
Program run, but in GPIO window fields PIN not changing(0x00).
Startup code generated by Keil master.
Problem in the program, simulator or startup code?
Thank you

part of program:

#define _BV(X) (1<<X)

int main(void)
{       LPC_SYSCON->SYSAHBCLKCTRL |= 0xE001001FUL;
        LPC_GPIO0->DIR = _BV(4)|_BV(5);
        LPC_GPIO0->SET = _BV(4)|_BV(5);

        /* Generate 1ms Ticks */
        SysTick_Config(SystemCoreClock / 1000);

while(1)
        {switch (msTicks)
                {
                case 500:
                        msTicks = 0;
                        LPC_GPIO0->CLR = _BV(4)|_BV(5);
                        break;
                case 100:
                case 200:
                case 300:
                        LPC_GPIO0->NOT = _BV(4)|_BV(5);
                        break;
                }
                __WFI();
        }
}

Parents
  • No. Debugging in a simulator will catch a huge number of bugs that are obviously in the own code. If the simulation prunes 80% of the bugs, it has still been a great help since more time will be available for hunting the remaining 20% when the real hardware prototype finally shows up.

    And not only that - a bug found in a simulator that you can't easily conclude is a bug in the application code can often be reproduced by a smaller test program that could be run on a real processor even if you don't have the final hardware needed for running the full program.

Reply
  • No. Debugging in a simulator will catch a huge number of bugs that are obviously in the own code. If the simulation prunes 80% of the bugs, it has still been a great help since more time will be available for hunting the remaining 20% when the real hardware prototype finally shows up.

    And not only that - a bug found in a simulator that you can't easily conclude is a bug in the application code can often be reproduced by a smaller test program that could be run on a real processor even if you don't have the final hardware needed for running the full program.

Children