PWM Timer And CANBus PIN

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

PWM Timer And CANBus PIN

Postby msahin1976 » Thu Sep 05, 2019 9:28 am

Hello Everyone,
I'm using PIC18F45K80 and PIC18F46K80 at my projects and I face a problem when tried to adjust at FlowCode 6.

I can't select Timer 4 at PIC18F46K80 microcontroller for PWM.

I can't select second CANBus pins (CANTX C6, CANRX C7) at PIC18F46K80 and PIC18F45K80.

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

Re: PWM Timer And CANBus PIN

Postby Benj » Fri Sep 06, 2019 1:46 pm

Hello,

I beleive both of these features are currently available in Flowcode 8.

You can use the 30-day trial to find out if version 8 is more suitable for your requirements.
These users thanked the author Benj for the post:
msahin1976 (Mon Sep 09, 2019 1:57 pm)
Rating: 5.26%
 

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PWM Timer And CANBus PIN

Postby msahin1976 » Mon Sep 09, 2019 7:27 am

Hi Benj,
I checked Flowcode 8 for this issue as you told me. But it has the same problem.

Also, I prefer Flowcode 6 which should be already doing these stuff.

msahin1976
Posts: 18
Joined: Tue Aug 23, 2016 8:03 am
Has thanked: 3 times
Been thanked: 2 times
Contact:

Re: PWM Timer And CANBus PIN

Postby msahin1976 » Mon Sep 09, 2019 1:56 pm

Hi Benj,
I was able to select TMR4 for PWM by writing to the registers. I have written down codes for those who interested.

"
#define TMR4PRESCALE 1
pr4 = (32000000 / (5000 x 4 x TMR4 PRESCALE)) -1;
ccptmrs = ccptmrs | 0b00000010;
ccp4con = ccp4con | 0b00001100;
t4con = t4con | 0b00000101;
trisc = trisc | 0b00000100; "

I was wrong about the CANBus alternative pins. Choosing alternative pins for CANBus was about configuring the microcontroller. It worked correctly when configured.