diff --git a/blinker02/README b/blinker02/README index fa81e17..3a39192 100644 --- a/blinker02/README +++ b/blinker02/README @@ -13,3 +13,8 @@ appears that the timer is runing at about a megahertz, 1 million ticks per second. I am guessing it is divided down from the 700MHz somewhere, will dig deeper. +Hmm, there are comments in the manual about the system clock coming up +at 250MHz. I wonder if this system timer is 250MHz/256 = 0.976MHz. + + + diff --git a/blinker02/blinker02.c b/blinker02/blinker02.c index dd10896..36a39a1 100644 --- a/blinker02/blinker02.c +++ b/blinker02/blinker02.c @@ -11,6 +11,10 @@ extern void dummy ( unsigned int ); #define GPSET0 0x2020001C #define GPCLR0 0x20200028 +//0x01000000 17 seconds +//0x00400000 4 seconds +#define TIMER_BIT 0x00400000 + //------------------------------------------------------------------------- int notmain ( void ) { @@ -27,17 +31,13 @@ int notmain ( void ) while(1) { ra=GET32(SYSTIMERCLO); - //0x01000000 17 seconds - if((ra&=0x01000000)==0x01000000) break; - //0x00400000 4 seconds - if((ra&=0x00400000)==0x01000000) break; + if((ra&=TIMER_BIT)==TIMER_BIT) break; } PUT32(GPCLR0,1<<16); while(1) { ra=GET32(SYSTIMERCLO); - //if((ra&=0x01000000)==0x00000000) break; - if((ra&=0x00400000)==0x00000000) break; + if((ra&=TIMER_BIT)==0) break; } } return(0);