Hi E,hi C,
His binary value is 0x55AA, so it cannot be used with CCPR1
It should be
CCPR1L = 0xAA.
CCPR1H =0x55
E

Hi E,hi C.
In the following Code, I assume you have defined Frame as a WORD
Dim Frame as Word
Frame = 2000' I prefer 0x07D0
CCP1CON = %00001000 '& h8 'CCP1 pin low and high on match - will be first pulse
CCPR1L = frame.LB '2000 ' loads Low Byte 0xD0 into Lo
CCPR1H = frame.HB '2000 'loads High Byte 0x07 into Hi
PIE1.CCP1IE = 1 'enable CCP1 interrupts
Hi E,
Hi E,
Hi S,I notice in data sheet an example something like:
CCPR1H:CCPR1L = 0x0465
does that work in Oshonsoft
If not, then you have to work with bytes and/or mapping HB and LB
Why the extra steps?Hi E,
This works.
C.
==========================================
Dim frame As Word
frame = 0x07d0 '2000
Dim framehb As Byte
framehb = frame.HB
Dim framelb As Byte
framelb = frame.LB
Main_loop:
CCPR1H = framehb
CCPR1L = framelb
Goto Main_loop
Hi J,Why the extra steps?
framehb = frame.HB
CCPR1 = framehb,
when CCPR1 = frame.HB is the same
Hi E,hi C.
Why not just
CCPR1H = 0x07
CCPR1L = 0xD0
or
CCPR1H = Frame.HB
CCPR1L = Frame.LB
Hi E,hi C<
My advice would be to forget about AI, use techniques you understand.
E
They wrote CCP1 = 2000, which the C- compiler might make to two instructions or use a pointer, but Oshonsoft can't do directly.Hi E,
I suppose this is ok, but I'm trying to edit a program that was written in 'C' and translated by AI, which has 2000. This didn't work, so I ded a variable FRAME which is = to 2000.
As someone else wrote it for me, I try to keep is as near to what they wrote as I can.
C
Hi E,
Hi J,They wrote CCP1 = 2000, which the C- compiler might make to two instructions or use a pointer, but Oshonsoft can't do directly.
Is there some problem, if the word variable is written with high- and low byte to CCPR1H and CCPR1L