Page 1 of 1

PWM Timer And CANBus PIN

Posted: Thu Sep 05, 2019 9:28 am
by msahin1976
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.

Re: PWM Timer And CANBus PIN

Posted: Fri Sep 06, 2019 1:46 pm
by Benj
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.

Re: PWM Timer And CANBus PIN

Posted: Mon Sep 09, 2019 7:27 am
by msahin1976
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.

Re: PWM Timer And CANBus PIN

Posted: Mon Sep 09, 2019 1:56 pm
by msahin1976
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.