Page 1 of 1

pwm on 18f4685

Posted: Thu Jul 08, 2010 3:39 pm
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

Re: pwm on 18f4685

Posted: Thu Jul 08, 2010 4:06 pm
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.

Re: pwm on 18f4685

Posted: Thu Jul 08, 2010 4:32 pm
by saschech@gmx.de
Hello Benj

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

Regards Wolfgang

Re: pwm on 18f4685

Posted: Fri Jul 09, 2010 11:05 am
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.

Re: pwm on 18f4685

Posted: Fri Jul 09, 2010 12:00 pm
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

Re: pwm on 18f4685

Posted: Fri Jul 09, 2010 12:18 pm
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.

Re: pwm on 18f4685

Posted: Fri Jul 09, 2010 12:51 pm
by saschech@gmx.de
Hello Benj

Work well.

Regards wolfgang