Pic30F4012 PWM not assign customer pin

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

Moderator: Benj

Post Reply
Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times

Pic30F4012 PWM not assign customer pin

Post by Ferla »

Hello to all
Finding a micro component PWM pin assign different problem.
When I import the component PWM this remains set to PORTD.
Can you tell me why?
I put flags on writing, I view the PIC component, but when I select the Port to me concerned this always repeats PORTD.0
Thanks to you all for the help
Ferla

Docara
Posts: 315
Joined: Sun Jun 23, 2013 1:29 pm
Has thanked: 28 times
Been thanked: 61 times

Re: Pic30F4012 PWM not assign customer pin

Post by Docara »

Hi Ferla,

I don't fully understand what you're asking but if I understand you correctly you cant change the required pins for PWM.

First off - what microcontroller are you using? depending on the device you might only be limited to 1 pin so that's why Flowcode doesn't allow you to change it.
Have you gone into the properties of the device and tried to change the pins - most microcontrollers have a minimum of 2 PWM channels. When you have set up the required Port/pins you can then use them in your program.

Look at the datasheet for the device you are using, it will tell you which pins are used with the onboard PWM (Flowcode should reflect this)

Matt

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times

Re: Pic30F4012 PWM not assign customer pin

Post by Ferla »

Hello Matt
Thank you for your kind reply.
Step by step:
- Micro I am using is the dsPic30F4012 which has excellent characteristics for driving DC and BLDC motors, as shown in the figure to well 6 PWM outputs, Pin 21,22,23,24,25,26
-flowcode: when I insert in the panel proposed the PWM component in the default PORTD.0, unfortunate that this micro has no PORTD.0
-If I want to change this PORT is not saved.

I think there is a problem in Flowcode with this component, perhaps the Matrix staff can help me.

Another thing I noticed, and the representation of the component indicates that only one port UART Tx / Rx pins 18, 17 when in fact the PIC has 2 Tx / Rx, Pin 13, 14, 18, 17.

I take this opportunity by asking a few friends of the forum if you have some help in the realization of a BLDC motor control.

Waiting for help Wave All, sorry for my english
Ferla

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Pic30F4012 PWM not assign customer pin

Post by QMESAR »

Ferla wrote: - Micro I am using is the dsPic30F4012 which has excellent characteristics for driving DC and BLDC motors, as shown in the figure to well 6 PWM outputs, Pin 21,22,23,24,25,26
-flowcode: when I insert in the panel proposed the PWM component in the default PORTD.0, unfortunate that this micro has no PORTD.0
Yes it is true that the 30F and the 33EP devices have excellent characteristics to drive Motors and a very good PWM module however these features are not supported in FC you can use this MC PWM in FC but you have to use a C component configure the module to your needs and update the duty cycle registers from the C component

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: Pic30F4012 PWM not assign customer pin

Post by Benj »

Hello,
Another thing I noticed, and the representation of the component indicates that only one port UART Tx / Rx pins 18, 17 when in fact the PIC has 2 Tx / Rx, Pin 13, 14, 18, 17.
I'm afraid that the 30F4012 device has only one UART peripheral, the 30F4011 has 2 UARTs.

I've made a note to investigate the advanced PWM on this device to see if we can allow it to work in Flowcode using a component.

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times

Re: Pic30F4012 PWM not assign customer pin

Post by Ferla »

Thank you all.
Fantastic . Now the control of these BLDC motors is increasingly in demand both for home use as CNC construction in both the industrial and robotics world.
It would be great to have something that will help using Flowcode.
I await your updates.
Ferla

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Pic30F4012 PWM not assign customer pin

Post by QMESAR »

Benj wrote:
I've made a note to investigate the advanced PWM on this device to see if we can allow it to work in Flowcode using a component.
:wink: :D Ben my friend you promised this to me more than 2 years ago I am surprised that you again make a note of it :D .just on a side note the PIC16F1xxx and the dsPIC33EP's all have this PWM module it is not only valid for the 30F4012
and or ECIOP16 has the same PWM module if I am not mistaken looking forward to a component for this module :D

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: Pic30F4012 PWM not assign customer pin

Post by Benj »

Hello Ferla,

For a CNC type application you may be better off using steppers rather than BLDC, that way you don't need expensive encoders. I have a 3D printer, a CNC and a PnP all using steppers.

Hi Peter,

I have been making incremental improvements to the PWM component over the last 2 years, we now support a lot of none CCP type PWM channels on a lot of the PIC 8-bit and PIC 16-bit devices.

The problem with these additional advanced PWMs is that they are so different from device to device that it's hard to create a component that can actually expose the good parts of the peripheral like complementary outputs etc. I started a similar thing for comparators and there is just so much variation that it's hard to cover everything while making it useful enough to cover the corner cases that customers actually want.

I'll try and spend some more time on the advanced PWM for you and see if I can come up with something that works.

Ferla
Flowcode v5 User
Posts: 126
Joined: Sun Jan 06, 2013 8:58 pm
Location: Italy
Been thanked: 19 times

Re: Pic30F4012 PWM not assign customer pin

Post by Ferla »

Hello Benj
I always take a cue from the industrial world and try to understand the why of certain choices.
Has for some time I want a printer cnc but I always see on the web coarse printers without an effective position control axes. All printers are also beautiful and functional, but when it comes to precision , we sun another planet ....
I want to implement a closed-loop axes and linear encoders to know precisely where they are actually minimizing errors. Needless to make PID though I backlash mechanical . I'm considering the purchase of linear guides in UP Class Bosh.
Ferla

User avatar
QMESAR
Valued Contributor
Valued Contributor
Posts: 1287
Joined: Sun Oct 05, 2014 3:20 pm
Location: Russia
Has thanked: 384 times
Been thanked: 614 times

Re: Pic30F4012 PWM not assign customer pin

Post by QMESAR »

Benj wrote: The problem with these additional advanced PWMs is that they are so different from device to device that it's hard to create a component
Hi Ben
I agree with you these advanced PWM module are truly advanced and has many different options and setting, I can believe that it is no easy task to make a generic component ,the best way is as we are doing it now C code component :D
I appreciate you looking and trying this out good luck

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: Pic30F4012 PWM not assign customer pin

Post by Benj »

Hello Ferla,
Has for some time I want a printer cnc but I always see on the web coarse printers without an effective position control axes.
A stepper motor with a micro stepping driver such as the EZdriver gives you up to 1024 micro steps per step which should give you something less than 0.01mm accuracy, the mechanics of the anti backlash and the squareness of the machine are usually bigger contributing factors to the positioning error then the drive motors themselves. Just trying to save you a fortune in terms of trying to re-invent the wheel :wink:

This is the design I followed to build my CNC which has a 1mm/1280 (0.00078mm) resolution with the driver set to give just 8 microsteps per step.
https://www.instructables.com/id/3D-printed-CNC-mill/

From my experience BLDC motors are useful for super high speed rotation rates for things like model RC cars, planes and helicopters.

Post Reply