I was up working on this all night
That's a shame. I can analyze any CCF code in a minute or two, including a graph of the code. A graph of the ON code is attached.
What PIC do you plan to use? It's easy to get higher frequencies using hardware PWM. I do it with a PIC12F683 but you'll probably want more pins. There's an example program on the Reynolds Electronics website. Here's some test code that generates ~120kHz.
Code:
DEFINE OSC 8
@ DEVICE PIC12F683, INTRC_OSC_NOCLKOUT
@ DEVICE PIC12F683, MCLR_OFF
TRISIO.2 = 0 'GPIO.2=Output
PR2 = 17 'PWM Period 117.7kHz
CCPR1L = 8 'PWM Duty-Cycle
'CCP1CON = %00001100 'PWM Mode
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
'CCP1CON = 0 'PWM module off
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
I get somewhat different values.- Carrier=38740
Lead-in=4.259ms ON, 3.872ms OFF
1-bit=1.187ms ON, 6.557ms OFF
0-bit=3.665ms ON, 3.872ms OFF
Lead-out=11.616ms ON, 92.928ms OFF
If all codes use the same lead-in & lead-out, the binary codes are 1100 0001 11 and 1101 0001 01 for OFF & ON respectively.
Bookmarks