Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/02/07 08:44
Read: times


 
#145227 - Ok, I post another in pre-formated one ;-)
Responding to: ???'s previous message
#include "RF04EB.h"
#include "hal.h"
#include "cul.h"

WORD BRUSHLESS1, BRUSHLESS2;
BOOL fBrushless;

#pragma vector=T1_VECTOR
__interrupt void T1_Interrupt_handler(void){
  if (fBrushless) {
    halSetTimer1Period(BRUSHLESS1);
    fBrushless = FALSE;
    P1_3 = 1;
  }
  else {
    halSetTimer1Period(BRUSHLESS2);
    fBrushless = TRUE;
    P1_3 = 0;
  };
}

void main(void)
{
  SET_MAIN_CLOCK_SOURCE(CRYSTAL);
  INT_GLOBAL_ENABLE(INT_ON);              // Global Interrupt enabled
  INT_ENABLE(INUM_T1, INT_ON);            // Interrupt TIMER1 enabled
  
  //TIMER1_INIT();
  T1CTL = 0x02;
  T1CCTL0 = 0x44; //***** THIS IS THE STRANGE PART!!!
  T1CCTL1 = 0x00;
  T1CCTL2 = 0x00;
  TIMIF &= ~0x40;

  TIMER1_ENABLE_OVERFLOW_INT(TRUE);       // TIMER1 Overflow Mask

  BRUSHLESS1 = 1000;
  BRUSHLESS2 = 1000;
  TIMER1_RUN(TRUE);                       // Start TIMER1

  IO_DIR_PORT_PIN(1, 3, IO_OUT); // P1.0 as output
  P1SEL &= ~0x08;                         // general purpose I/O

  //do {
  //} while (1);


List of 14 messages in thread
TopicAuthorDate
CC2430 Timer1 strange behaviour            01/01/70 00:00      
   How to use the 'Insert Code' button            01/01/70 00:00      
   Ok, I post another in pre-formated one ;-)            01/01/70 00:00      
      Brushless1 & 2            01/01/70 00:00      
         IAR            01/01/70 00:00      
            Linker            01/01/70 00:00      
   limit values            01/01/70 00:00      
      limit values            01/01/70 00:00      
         Why do you suspect the Linker??            01/01/70 00:00      
            Problem solved!            01/01/70 00:00      
               That indicates a flaw in your code!            01/01/70 00:00      
                  Understaning C Compiler Optimisations            01/01/70 00:00      
                  Buggy compilers.            01/01/70 00:00      
                     If you fully understand the issues            01/01/70 00:00      

Back to Subject List