|
Hi Friends
I'm Starter in Atmel ARM Programming. I Write a simple Project, in this project I turn On 3 LEDs Step by Step, at the end I turn off these LEDs. now I have problem with Machine Cycle, My Project Work normally but after Several Second my Micro Reset and Restart Again, I think after several Minute My Micro Complete machine Cycle and Restart Again.
My question is, how do I can reset Machine Cycle at the end of my Project Loop?
this is my Project Source:
#include <AT91SAM7s256.H> /* AT91SAMT7S64 definitions */
int n; void delay(void);
int main (void) { *AT91C_PIOA_PER = 0xFFFFFFFF; // Set in PIO mode *AT91C_PIOA_OER = 0xFFFFFFFF; // Configure in Output *AT91C_PIOA_OWER = 0xFFFFFFFF;
*AT91C_PIOA_SODR = 0x00000001 ; delay(); *AT91C_PIOA_SODR = 0x00000040 ; delay(); *AT91C_PIOA_SODR = 0x00001000 ; delay(); *AT91C_PIOA_CODR = 0x00001000 ; delay(); *AT91C_PIOA_CODR = 0x00000040 ; delay(); *AT91C_PIOA_CODR = 0x00000001 ; delay(); } void delay (void){ for (n=0; n<2500; n++); }
I Use 18.423 MHz Crystal.
|