3 pwm PIC

16 views
Skip to first unread message

Hans van Veldhuizen

unread,
Sep 5, 2024, 11:20:41 AM9/5/24
to jallist
Hello,
I want to control 3 small motors with PWM. How can I find a PIC that can do that?
greetings
Hans

Pinhead

unread,
Sep 5, 2024, 11:28:47 AM9/5/24
to jal...@googlegroups.com

Hi Hans,

There are tons of PICs capable of doing this.

To find the one that suits you need, go to this page on the Microchip website: 

https://www.microchip.com/en-us/parametric-search.html/717?filters=JTdCJTIyY2F0ZWdvcnlkcm9wZG93biUyMiUzQSU1QiUyMk1pY3JvY29udHJvbGxlcnMlMjBhbmQlMjBNaWNyb3Byb2Nlc3NvcnMlMjIlMkMlMjI4JTIwLSUyMGJpdCUyME1pY3JvY29udHJvbGxlcnMlMjIlMkMlMjI4LWJpdCUyMFBJQyUyME1DVSUyMiU1RCU3RA==

And in the filters (button on the left), there are three lines where you can set the number of PWM's you need.  Scroll down a bit and they will appear.

In the filtered list you can choose the one you like....

Hope this helps


Le 05-09-24 à 17:20, Hans van Veldhuizen a écrit :
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallist/6607696a-48b9-42a1-9f43-74af179aece3n%40googlegroups.com.

David VB

unread,
Sep 5, 2024, 11:32:31 AM9/5/24
to jallist
Be sure to select if you want a complementary output if you need your motors to go both directions and if you don't have an external driver who does the work of generating the complementary waveforms (Microchip also have a lot of those -- see their Motor Drivers section)

Hans van Veldhuizen

unread,
Sep 5, 2024, 1:46:51 PM9/5/24
to jallist

Hello,
I still have a few 16F15324 lying around and when I look at the list it should indeed give 3 PWM outputs. but how do I do that???
I don't understand anything from ppl.
greetings
Hans
Op donderdag 5 september 2024 om 17:32:31 UTC+2 schreef David VB:

Hans van Veldhuizen

unread,
Sep 5, 2024, 3:01:22 PM9/5/24
to jallist
Have found a16F15324 led  sample and changed, is this correct:
-- PWM setup. We need to map the two PWM outputs to the relevant pins.
include pps
pps_control_lock(FALSE)                     -- unlock PPS module
RC3PPS = PPS_PWM3OUT                        -- pin_C3 is PWM3
RC5PPS = PPS_PWM4OUT                        -- pin_C5 is PWM4
RC4PPS = PPS_PWM5OUT                        -- pin_C4 is PWM5------------  added
pps_control_lock(TRUE)                      -- lock PPS module
pin_C3_direction = output                   -- don't forget to set this to output
pin_C5_direction = output                   -- don't forget to set this to output
pin_C4_direction = output                   -- don't forget to set this to output-----------  added
include pwm_hardware                        -- fetch PWM library
pwm_max_resolution(1)                       -- max res. with highest possible freq.

Op donderdag 5 september 2024 om 19:46:51 UTC+2 schreef Hans van Veldhuizen:

Pinhead

unread,
Sep 5, 2024, 6:57:27 PM9/5/24
to jal...@googlegroups.com

Hans,

The first question to know is the type of motor you want to control (stepper of classic, like a fan)

Second, you have to know if the motor will turn only in one direction or in both direction

Third, beware of the PWM frequency.  To control a motor, the frequency is important (much more than for controling LED's).   The highest frequency is not always the best since it can cause some mechanical resonance and other problems in the drivers with an excess of reverse current.

This is why it is also important to use a dedicated gate driver to control the Mosfet or MosfetS


Le 05-09-24 à 21:01, Hans van Veldhuizen a écrit :

Hans van Veldhuizen

unread,
Sep 6, 2024, 4:20:03 AM9/6/24
to jallist
Hello Pinhead,
I use PWM for both small motors and larger ones with ready-made driver sets, but so far one or two. I think I now have a test version (which I still have to put together) see attachment.
If you have any tips, please let me know.
Thanks
Hans

Op vrijdag 6 september 2024 om 00:57:27 UTC+2 schreef Pinhead:
16f15324_ijsdance_2.jal
Reply all
Reply to author
Forward
0 new messages