示例#1
0
/**
 @fn main()
 @brief just to test PWM module including drive, speed.
 @return none
 */
void main()
{
        //PCA0MD = 0x00;
        UART0_PORT_Init();
        PWM_PORT_Init();
        OSCILLATOR_Init();
        PCA0_Init();
        EA = 1;
        set_pwm_duty_cycle(50);
}
示例#2
0
void main (void) {

	
   // Disable watchdog timer
   WDTCN = 0xde;
   WDTCN = 0xad;

   Port_Init ();                       // Initialize crossbar and GPIO
   Oscillator_Init ();                 // Initialize oscillator
   PCA0_Init ();                        // Initialize PCA0

   EA = 1;                             // Globally enable interrupts

	
   while (1);                          // Spin here to wait for ISR
   {
      
   }                                   // end of while(1)	
}
示例#3
0
文件: exam.c 项目: bigclean/wzupwm
/*!
 * \fn main()
 * \brief just to test PWM module
 * \return none
 */
int main()
{
	PCA0MD = 0x00;
	PORT_Init();
	OSCILLATOR_Init();
	PCA0_Init();
	timer_0_1_init();
	timer2_init();
	IN1 = 0;
	IN2 = 1;
	IN3 = 0;
	IN4 = 1;
	EA = 1;
	//set_pwm_0_duty_cycle(20);
	//set_pwm_1_duty_cycle(16);
	while (1)
	{
		//set_pwm_0_duty_cycle(700);
		//set_pwm_1_duty_cycle(660);
		set_wheel_1_speed(50);
		set_wheel_0_speed(50);
	}
}