PIC18F2331 pwm

Post here to discuss any new features, components, chips, etc, that you would like to see in Flowcode.
Post Reply
KikeRico
Posts: 21
http://meble-kuchenne.info.pl
Joined: Wed Aug 10, 2022 1:42 am
Location: Mexico
Has thanked: 2 times
Been thanked: 7 times

PIC18F2331 pwm

Post by KikeRico »

Hello,

I have a doubt related to PWM of the PIC18F2331 family. They have 6 or 8 channels in hardware, but FC9 only permit 2 channels.

Please you could consider to include more channels for this PIC family. It should be very useful for ACIM control technics & algorithms, we need to use 6 PWM channels at minimum for control the motors.

Thanks a lot.

User avatar
p.erasmus
Posts: 434
Joined: Thu Dec 03, 2020 12:01 pm
Location: Russia / Россия
Has thanked: 104 times
Been thanked: 88 times

Re: PIC18F2331 pwm

Post by p.erasmus »

KikeRico wrote:
Fri Dec 23, 2022 2:32 am
I have a doubt related to PWM of the PIC18F2331 family. They have 6 or 8 channels in hardware, but FC9 only permit 2 channels.
Hi,

The FC PWM Component supports the Standard CCP module(PWM) of the chip this particular chip has only two CCP modules the reason you can only select 2 PWM signals.

The 2331 chip has a specific module for Driving PMSM Motors (Brushless or Induction for example) which is called the MCPWM module which contains on this chip PWM0 - PWM5 this module allows you to run various Motorcontrol of Switch mode Power Supply circuitry ,however due to its many available configurations makes it hard to make a component that can serve all the different configurations,Matrix has in the past indicated that they will not do this ,however may be they will be willing now. We have been using a C code icon and with the help of the Datasheet configure the MCPWM module in FC for our needs.

As you will see below to the left is the 2 channel CCP module and on the Right the 6 channel MCPWM module


P1.JPG
P1.JPG (28.42 KiB) Viewed 1695 times
Regards Peter - QME Electronics

Steve-Matrix
Matrix Staff
Posts: 1257
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 168 times
Been thanked: 279 times

Re: PIC18F2331 pwm

Post by Steve-Matrix »

It is simple to integrate a few lines of C code within Flowcode to control the more advanced and esoteric functions of the more complicated microcontrollers.

Some of these modules have many features and it is difficult to cover all possibilities with a component.

KikeRico
Posts: 21
Joined: Wed Aug 10, 2022 1:42 am
Location: Mexico
Has thanked: 2 times
Been thanked: 7 times

Re: PIC18F2331 pwm

Post by KikeRico »

Hi guys,

p.erasmus thanks a lot for the CCP module explanation, now is clear for me why many of micro-controllers (PICs) have one or two PWM channels only. For PIC more specific hardware, like MCPWM in PIC18F2331, I need to deal with C code to explode all characteristics as mention by Steve-Matrix.

My interest in MCPWM module is to use in AICM control. I'll try to do with C code :D

Best regards,
KikeRico

artan
Posts: 13
Joined: Mon Oct 11, 2021 5:27 pm

bldc

Post by artan »

wher to get a bldc project in flowcode

BenR
Matrix Staff
Posts: 1742
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 443 times
Been thanked: 604 times

Re: PIC18F2331 pwm

Post by BenR »

Hello,

A simple way to control a brushless DC motor in Flowcode is to use the Servo Motor controller component and connect this to a brushless ESC. If you want to connect the brushless motor directly to the microcontroller then this is a bit more tricky. We will soon be looking into field oriented control for brushless motors but at the moment you might be better off using several of the H-bridge components or even driving the outputs yourself using output pins and a timer interrupt.

Post Reply