Anand,
The 8-pin 12F683 has HWPM and only costs slightly more than the 12F629 or 12F675. I posted a simple example of turning it on/off using ~120kHz with 1ms bursts at 10ms intervals in another thread recently. Here it is again...
Code:
DEFINE OSC 8
@ DEVICE PIC12F683, INTRC_OSC_NOCLKOUT, MCLR_OFF
TRISIO.2 = 0 'GPIO.2=Output
PR2 = 17 'PWM Period 117.7kHz
CCPR1L = 8 'PWM Duty-Cycle
T2CON = %00000100 'Timer2=ON, 1:1 prescale
OSCCON = %01110001 'INT HF OSC 8MHz
WHILE OSCCON.3>0: WEND 'OSC startup timeout
WHILE OSCCON.2=0: WEND 'INT HF OSC stable
WHILE OSCCON.2>0
CCP1CON = %00001100 'PWM ON
PauseUS 1000 'generate 1ms burst
CCP1CON = 0 'PWM OFF
Low GPIO.2
Pause 10 'pause 10ms
WEND
The disadvantage of using XOUT is that it cannot send microdim/microbright and cannot send the extended commands X-10 introduced 6-7 years ago.
Bookmarks