Error on PWM with new Version 3.4.7.48

Forum for problems or queries regarding the Flowcode application and compiler usage.

Moderators: Benj, Mods

Post Reply
trfsc9
Posts: 4
Joined: Tue Sep 16, 2008 3:55 pm
Contact:

Error on PWM with new Version 3.4.7.48

Post by trfsc9 »

Hallo,

i have a Problem with the PWM-Component on the new Version 3.4.7.48 and the PIC18F4680

With the old Version 3.2.2.40, in the PWM-Component i had 2 PWMs, which where on the chip at PWM_Index1: CCP1 and PWM_Index2: ECCP1

With the new Version, the PWM-Component is as follows PWM_Index2: CCP1 and PWM_Index1: don't drives any PWM

All my old Flowcode-Programs compiled with the new Version don't have the 2 PWMs, but before they had.

Thanks for the help!

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: Error on PWM with new Version 3.4.7.48

Post by Benj »

Hello

I have just tried the PWM component here using the latest version of FLowcode and 2 PWM channels are being shown.

Please can you try replacing the 18F4680 definition file for your Flowcode by copying the attached file into your Flowcode V3/FCD directory.

Let me know if this helps your situation.
Attachments
18F4680.fcd
(7.98 KiB) Downloaded 265 times

trfsc9
Posts: 4
Joined: Tue Sep 16, 2008 3:55 pm
Contact:

Re: Error on PWM with new Version 3.4.7.48

Post by trfsc9 »

Hello,

my Problem already exists.
The 2 PWM channels are shown in Flowcode, but the problem is, that the software on the chip is not as it should.

I installed the old version of Flowcode, but there is now the same problem. Only my old compiled versions have the correct function.

On the chip, PWM1 should be on Port C2 (CCP1) and PWM2 should be at Port D4 (ECCP1). I have compiled versions, where it is so.
But now, when i compile the same program again, PWM1 has no function and PWM2 is at Port C2.

trfsc9
Posts: 4
Joined: Tue Sep 16, 2008 3:55 pm
Contact:

Re: Error on PWM with new Version 3.4.7.48

Post by trfsc9 »

Now i have a solution for my problem.
I don't know why i did this, but it solves the problem.

I added following lines to the PIC18F4680.h in \boostc\include\ :

volatile char ccp2con @ECCP1CON;
volatile char ccpr2 @ECCPR1;
volatile char ccpr2l @ECCPR1L;
volatile char ccpr2h @ECCPR1H;

I added this lines after the line: volatile char ccpr1h @CCPR1H;

Does anyone knows, what i've done there? I know it solves my problem, but i don't know why :roll:

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: Error on PWM with new Version 3.4.7.48

Post by Benj »

Hello

Ok where did you find that piece of code. Im guessing that the BoostC library is missing a few definitions for that particular chip and adding those lines of code will allow the PWM registers to be addressed correctly.

trfsc9
Posts: 4
Joined: Tue Sep 16, 2008 3:55 pm
Contact:

Re: Error on PWM with new Version 3.4.7.48

Post by trfsc9 »

I find it out by myself over an year ago. My problem was, that i forgot the changes i made and that i don't took a backup of this file.
In this file i made many more changes, because the CAN component also didn't work with the PIC18F4680 without changes. There are Compiler-Errors with the original file.

Post Reply