mauricio fernandez montoya

MC68HC908JK1  - Timer Interface Module Problems

Discussion created by mauricio fernandez montoya on Aug 11, 2007
Latest reply on Apr 21, 2009 by Jim Burdus

Hi:
i'm in trouble with the configuration of the TIM module of MC68HC908JK1 microcontroller.   i wwant to use it as an PWM output to trigger a led in a IR reflective sensor.  it seems that the sintaxis is good, but it doesn't work!!!!! 

this is the program (section of the TIM configuration):

unsigned int Frecuencia=40;
unsigned int Dureza=4;
unsigned int Modulo;
unsigned int Duty;


void Emisor(void){
Modulo=2500/Frecuencia;
Duty=Dureza*Modulo/100;
TSC_TSTOP=1;
TSC_TRST=1;
TMOD=Modulo;
TCH0=Duty;
TSC0_MS0A=1;
TSC0_ELS0B=1;
TSC0_TOV0=1;
TSC_TRST=0;
TSC_TSTOP=0;
}

Thanks!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Added part number to subject.



Message Edited by NLFSJ on 2007-08-12 11:46 PM

Outcomes