pwm with 18f8722
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
pwm with 18f8722
Hallo together
Is there a help-file for the pwm macro?
Where i can set the output pin?
regards wolffgang
Is there a help-file for the pwm macro?
Where i can set the output pin?
regards wolffgang
- 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 with 18f8722
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
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
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
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
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
If i want compiling with PIC 18f6722 i have the thame problem.
I must have a fixed fcd-file for both.
Regards wolfgang
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
Hallo Benj
Why you giv not a statment?I install my flowcode new and have the same problem.
Regards wolfgang
Why you giv not a statment?I install my flowcode new and have the same problem.
Regards wolfgang
- 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 with 18f8722
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
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
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
- 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 with 18f8722
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
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
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
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.
You have to it in your FCD folder and replace the original file.
Let me know if your problem is resolved.
- Attachments
-
- 18F8722.fcd
- (10.58 KiB) Downloaded 291 times
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
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
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
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
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
-
- Posts: 714
- Joined: Wed Jan 31, 2007 12:41 pm
- Has thanked: 1 time
- Been thanked: 26 times
- Contact:
Re: pwm with 18f8722
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
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