125 khz carrier signal generation
i want to generate 125khz carrier signal for rf reader.... can i do that using pic18f452?how?
or i need to use extra counter?
You could use the PICs PWM output, set to 50% at 125kHz
If teh 125kHz needs to be accurate your PIC will need a crystal controlled clock.
Code will be something like this snip used on a PIC18F4525.
;set up PWM on CCP1 for PSU sync generator & turn it ON
bcf TRISC, 2 ;set RC2 as output
bsf T2CON, TMR2ON ;turn on timer 2 unity pre and post scale
movlw .5 ;set up PWM period, PR2 register
movwf PR2
movlw .3 ;Set PWM duty cycle
movwf CCPR1L
movlw b'00001100' ;set up PWM with LSBs fo 10 bit mode to 00
movwf CCP1CON ;Turn PWM ON
You will have to set the values written to PR2 and CCP1RL to suit your clock frequency.
Hope this helps
Peter
