pwm on 18f4685

Moderator: Benj

Post Reply
saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

pwm on 18f4685

Post by saschech@gmx.de »

Hello Benj

The pic18f4685 pwm in simulation is ok,but if i compile i have error:

pwm_test.c
Starting preprocessor: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\pp.exe "D:\sachs_work\ECIO\pic v4 test\pwm_test.c" -i C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\include -d _PIC18F4685 -la -c2 -o "D:\sachs_work\ECIO\pic v4 test\pwm_test.pp" -v -d _BOOSTC -d _PIC18


..

D:\sachs_work\ECIO\pic v4 test\pwm_test.c(222:2): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(222:2): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(222:10): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(264:2): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(264:2): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(264:10): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(295:2): error: unknown identifier 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(295:2): error: invalid operand 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(295:9): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(367:2): error: unknown identifier 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(367:2): error: invalid operand 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(367:9): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:18): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:18): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:26): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:26): error: invalid operand '& '
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:34): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:34): error: invalid operand '| '
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:15): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(371:2): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(371:2): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(371:10): error: failed to generate expression
pwm_test.c success

failure

Return code = 1
Attachments
pwm_test.c
(8 KiB) Downloaded 264 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: pwm on 18f4685

Post by Benj »

Hello Wolfgang,

I have had a look at the device datasheet and the FCD is slightly incorrect. There is only 1 PWM enabled pin on this device.

I have regenerated the FCD with this error omitted and your program should compile correctly now though you will be unable to use PWM channel 2 on this device.
Attachments
18F4685.fcd
(12.04 KiB) Downloaded 274 times

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: pwm on 18f4685

Post by saschech@gmx.de »

Hello Benj

after i change the fcd file,i have the same error

Regards Wolfgang

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: pwm on 18f4685

Post by Benj »

Hello Wolfgang,

I was going to test your Flowcode file but then I noticed that you had only posted up the C code.

Are you still referring to PWM index 2 in a component macro in your program? If so then this would be enough to cause the compilation errors.

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: pwm on 18f4685

Post by saschech@gmx.de »

Hello Benj

I delete the 18F4685.fcd file and download new;
if i compile the code,only init > pwm(0)1 set cycle > pwm(0)1 i have the thame Error:

pwm_test.c
Starting preprocessor: C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\pp.exe "D:\sachs_work\ECIO\pic v4 test\pwm_test.c" -i C:\PROGRA~1\MATRIX~1\FLOWCO~1\BoostC\include -d _PIC18F4685 -la -c2 -o "D:\sachs_work\ECIO\pic v4 test\pwm_test.pp" -v -d _BOOSTC -d _PIC18


..

D:\sachs_work\ECIO\pic v4 test\pwm_test.c(222:2): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(222:2): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(222:10): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(264:2): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(264:2): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(264:10): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(295:2): error: unknown identifier 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(295:2): error: invalid operand 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(295:9): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(367:2): error: unknown identifier 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(367:2): error: invalid operand 'ccpr2l'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(367:9): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:18): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:18): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:26): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:26): error: invalid operand '& '
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:34): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:34): error: invalid operand '| '
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(370:15): error: failed to generate expression
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(371:2): error: unknown identifier 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(371:2): error: invalid operand 'ccp2con'
D:\sachs_work\ECIO\pic v4 test\pwm_test.c(371:10): error: failed to generate expression
pwm_test.c success

failure

Return code = 1
Attachments
pwm 4685.gif
pwm 4685.gif (30.78 KiB) Viewed 5034 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: pwm on 18f4685

Post by Benj »

Hello,

Woops sorry I left a define with the PWM channels still set to 2.

Here is a working FCD that should allow you to compile correctly.
Attachments
18F4685.fcd
(12.04 KiB) Downloaded 287 times

saschech@gmx.de
Posts: 714
Joined: Wed Jan 31, 2007 12:41 pm
Has thanked: 1 time
Been thanked: 26 times
Contact:

Re: pwm on 18f4685

Post by saschech@gmx.de »

Hello Benj

Work well.

Regards wolfgang

Post Reply