Page 1 of 1
pwm with 18f8722
Posted: Wed Dec 17, 2008 4:51 pm
by saschech@gmx.de
Hallo together
Is there a help-file for the pwm macro?
Where i can set the output pin?
regards wolffgang
Re: pwm with 18f8722
Posted: Wed Dec 17, 2008 5:29 pm
by Benj
Hello Wolfgang
The PWM is hardware controlled and therefore you cannot assign the pins. You may however be able to swap one or two the PWM pins by changing the configuration settings in the expert mode of PPP.
The PWM pins are marked as CCPx on the Chip diagram window. Eg CCP1 and CCP2 for channels 1 and 2.
Re: pwm with 18f8722
Posted: Thu Dec 18, 2008 11:01 am
by saschech@gmx.de
Hallo Benj
test_int_8722.c(563): FCD file error (5 > 2)
1 errors detected
Error: preprocessing error
I get this error if i start compiling,but it runs ok in debug mode.
Without:
pwm(0)
eneable(1)
pwm(0)
eneable(2)
pwm(0)
setdutycicle 1,11
pwm(0)
setdutycicle 2,99
the compiling is ok.
I read this over the pins:
The operations of PWM mode described in Section 17.4
β€PWM Modeβ€ apply to CCP4 and CCP5 only.
17.4 PWM Mode
In Pulse-Width Modulation (PWM) mode, the CCPx pin
produces up to a 10-bit resolution PWM output. Since
the CCP4 and CCP5 pins are multiplexed with a
PORTG data latch, the appropriate TRISG bit must be
cleared to make the CCP4 or CCP5 pin an output.
Figure 17-4 shows a simplified block diagram of the
CCP module in PWM mode.
For a step-by-step procedure on how to set up a CCP
module for PWM operation, see Section 17.4.3
β€Setup for PWM Operationβ€.
Note: Clearing the CCP4CON or CCP5CON
register will force the RG3 or RG4 output
latch (depending on device configuration)
to the default low level. This is not the
PORTG I/O data latch.
Please can jou help me?
Regards wolfgang
Re: pwm with 18f8722
Posted: Fri Dec 19, 2008 9:46 am
by saschech@gmx.de
Hallo Benj
If i want compiling with PIC 18f6722 i have the thame problem.
I must have a fixed fcd-file for both.
Regards wolfgang
Re: pwm with 18f8722
Posted: Wed Dec 24, 2008 5:59 am
by saschech@gmx.de
Hallo Benj
Why you giv not a statment?I install my flowcode new and have the same problem.
Regards wolfgang
Re: pwm with 18f8722
Posted: Wed Dec 24, 2008 12:32 pm
by Benj
Hi Wolfgang
Currently Flowcode V3 only supports a maximum of 2 PWM channels. The error you are receiving is simply stating that 5 is greater then the 2 currently supported channels. We have done this because the PWM settings go all over the place when using more then two channels across the range of chips. I will look into allowing support of more channels for your device.
Re: pwm with 18f8722
Posted: Thu Dec 25, 2008 11:17 am
by saschech@gmx.de
Hallo Benj
I work only with ch0 and become this error.
Regards wolfgang
Re: pwm with 18f8722
Posted: Mon Jan 12, 2009 11:46 am
by saschech@gmx.de
Hallo Benj
A long time i wait .
You dont can or want help me?
I have the thame problem with ...... sean send me a new fcd file without these problem!!!!
Regards wolfgang
Re: pwm with 18f8722
Posted: Mon Jan 12, 2009 1:09 pm
by Benj
Hello
Sorry I must have missed this post when it was made.
The PWM channels are numbered from 1 so the channel addresses that are valid are 1 and 2.
Re: pwm with 18f8722
Posted: Mon Jan 12, 2009 2:06 pm
by saschech@gmx.de
Hallo Benj
I put in the Macro:
A
PWM (0)
enable 1
PWM (0)
set duty cycle 1.55
goto A
and i receive the error 5 >1
Regards wolfgang
Re: pwm with 18f8722
Posted: Mon Jan 12, 2009 6:01 pm
by WalkOver
Try with this file.
You have to it in your FCD folder and replace the original file.
Let me know if your problem is resolved.
Re: pwm with 18f8722
Posted: Tue Jan 13, 2009 9:03 am
by saschech@gmx.de
Hallo walkover
Thank you,the *.fcd file works.
This fault is also in 17 other files!
On my bord PWM(0)
eneable 1
work on pin 43 / ecpp1
eneable 2 ??????????
isn`t work onmy board,it work in flocode simulation.........
Thank you again
Regards wolfgang
Re: pwm with 18f8722
Posted: Tue Jan 13, 2009 10:42 am
by WalkOver
Hello !
You have to replace this line on the wrong fcd files :
Define20=#define MX_PWM_CNT 5
by
Define20=#define MX_PWM_CNT 2
I don't have a 18F8722 but with Proteus ISIS, the simulation works well.
ECCP1 is on RC2 pin 43
ECCP2 is on RC1 pin 35
Re: pwm with 18f8722
Posted: Tue Jan 13, 2009 12:51 pm
by saschech@gmx.de
Hallo walkover
After your acknowledgment over the pin`s, i have a look
to my hardware,the bug a "cold soldered point " on pin 35.
Thank you for your great help!
Regards wolfgang