I try to use the PWM module of 12F683, but can't get signal on the CCP output. It is simulated by Proteus without success. There is no error message aftre build. I have tried the basic blinking LED application and it worked fine. I would like to ask you to find the problem in my code:
Code: Select all
/*******************************************************************************
CONFIG = 0x0FF4
Project > Edit project:
Oscillator: Internal RC No Clock
WDT: Off
PUT: Off
MCLRE: Enabled
CP: Off
Data EE RP: Off
BOD: BOD enabled, SBOREN disabled
Internal External SOM: Enabled
Monitor clock fail safe: Enabled
*******************************************************************************/
void main() {
OSCCON = 0b01000111; // internal oscillator at 1MHz
ADCON0 = 0; // ADC disabled
CMCON0 = 7; // comparator disabled
ANSEL = 0; // pins are digital
TRISIO = 0b00001000; // pins are output, GP3 always input
GPIO = 0;
PWM1_Init(1000);
PWM1_Start;
PWM1_Set_duty(127);
while(1){}
}
Bonca