Naruto Uzumaki

PWM on MC68H908JB

Discussion created by Naruto Uzumaki on Jun 23, 2011
Latest reply on Jul 1, 2011 by bigmac

Hi!

 

I am really new to freescale uControllers and I have been trying for a while to get a working pwm from JB8 controller but to no avail. following is my code:

 

#include <hidef.h> /* for EnableInterrupts macro */
#include "derivative.h" /* include peripheral declarations */

 

void main(void) {

  EnableInterrupts; /* enable interrupts */
  /* include your code here */
  TSC=(TSC&0xCF)|0x30;
  TMODH=0x00;
  TMODL=0x7F;
  TCH0H=0x00;
  TCH0L=0x7F;
  TSC0=TSC0|0x1A;
  TSC=TSC|0x20;
  while(1);

  for(;:smileywink: {
    __RESET_WATCHDOG(); /* feeds the dog */
  } /* loop forever */
  /* please make sure that you never leave main */
}

 

please help me as this is not working even though i followed all the steps in the datsheet

Outcomes