Thanks a lot ,
Am using the software code warrior V6.3 , MC9S08SG8 8 pin package type and here am attach my sample code ,
this code i have a same problem above mention , 7th pin of controller is pwm am using internal clk.
and this is my code .
/* Including needed modules to compile this module/procedure */
#include "Cpu.h"
#include "Events.h"
#include "PWM1.h"
/* Include shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"
unsigned int ADC_RESULT_TOTAL,ADC_RESULT[10],adc_value;
char a,b;
unsigned int ADC();
/* User includes (#include below this line is not maintained by Processor Expert) */
void main(void)
{
/* Write your local variable definition here */
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
/* Write your code here */
/* For example: for(;;) { } */
PWM1_Disable();
PWM1_ClrValue();
Cpu_Delay100US(1000);
for(;;)
{
setReg16(TPM2MOD, 4076);// period for 407Hz
TPM2C0V =3057; // 75% duty cycle
PWM1_Enable(); // enable the pwm
Cpu_Delay100US(5000); // delay for 50msec
PWM1_Disable(); // disable the pwm
Cpu_Delay100US(5000);
}
/*** Don't write any code pass this line, or it will be deleted during code generation. ***/
/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
for(;;){}
/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
}