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.
Hi all. Just as the title says, I am trying to generate a 1ms heartbeat timer on my XMC4500 hexagon board, but I am running into an error which you can see here: http://imgur.com/o5TGwms .
You can see there at the bottom in Build Output that I am getting the L6200E Error. Now, the reason it says .\Flash\Blinky.axf in front of the error is because I simply opened up the example Blinky project and deleted the contents of Source Files folder and replaced it with the sysTick.c code.
Any help is much appreciated.
Per, so essentially what I have to do is:
1.) Set pin 3.7 to output in 'push pull' mode 2.) Set pad driver for pin 3.7 to 'strong'
So here is what I have now (builds with no errors/warnings):
#include "stdio.h" #include "XMC4500.h" //SFR declarations of the selected device #include "xmc_gpio.h" #include "xmc4_gpio.h" uint32_t msTicks = 0; /* Variable to store millisecond ticks */ void SysTick_Handler(void) { /* SysTick interrupt Handler.*/ msTicks++; /*See startup file startup_XMC4500.s for SysTick vector */ // Set GPIO to alternate between HIGH/LOW if (msTicks & 1) // 2ms period, 500 Hz on scope PORT3->OMR = 0x00000080UL; // 7 & 1 is 1; 8 & 1 is 0 -- bitwise operation, so basically we are just looking at the least else // significant count to determine whether it's odd or even. If odd, signal to pin goes HIGH, PORT3->OMR = 0x00800000UL; // if even, signal to pin goes LOW. This completes our 2ms/500Hz cycle. } int main (void) { uint32_t returnCode; PORT3->IOCR0 = 0x80UL << 0; // P3.7 output, push pull PORT3->PDR0 = 0x02UL << 0; // P3.7 pad driver strong returnCode = SysTick_Config(SystemCoreClock / 1000); /* Configure SysTick to generate an interrupt every millisecond */ if (returnCode != 0) { /* Check return code for errors */ // Error Handling } while(1); }
I am still not sure how to go about error handling, but what do you think about what I have regarding my configurations of the GPIO?