cc 2430 Sleeping time

Thread Starter

dj_wizard

Joined May 11, 2009
5
Hello Everyone..
i m using the cc2430 along with an accelerometer and now i need it to sleep for 100ms so when i read from the st0 it s at the end of the ad conversion
how to let it read at the start up of the prog.
thnx
here is the code
void sleep_timer(void)
{
UINT32 Sleep_Time_Register = 0x00000000;
UINT8 ien_save[3];

Sleep_Time_Register |= ST0 ;
Sleep_Time_Register |= (UINT32)(ST1) << 8;
Sleep_Time_Register |= (UINT32)(ST2) << 16 ;
Sleep_Time_Register += SLEEP_TIME ;
ST2 = (UINT8)(Sleep_Time_Register >> 16) ;
ST1 = (UINT8)(Sleep_Time_Register >> 8) ;
ST0 = Sleep_Time_Register ;


SLEEP = 0x06 ; // Setup new power mode
IEN0 = 0xA0 ;
IEN1 = 0x00 ;
IEN2 = 0x00 ;
save_int (ien_save); // Save interrupts
PCON = 0x01 ; // Go to new powermode
load_int (ien_save); // Load interrupts
return;
 
Top