PWM library using a PCA9685?

17 views
Skip to first unread message

rob...@hotmail.com

unread,
Jan 16, 2022, 4:35:46 AM1/16/22
to jallist
Hello all,

I sometimes see projects using servo's using the JAL servo llibraries. I have not yet used any servo's but I regularly have a project with LEDs that uses PWM (like the servo library). 

The number of PWM channels is limited on a PIC and it may be that the timers on the PIC are needed for something else.

A solution would be to use a PCA9685. There are modules available to control up to 16 servo's (or LEDs) using this module.

I was wondering if there are JAL users that have plans to use this device. If so I might make a library for it in some near future.

Thanks.

Kind regards,

Rob

jsu...@gmail.com

unread,
Jan 16, 2022, 6:15:31 AM1/16/22
to jallist
Hi Rob,

Op zondag 16 januari 2022 om 10:35:46 UTC+1 schreef rob...@hotmail.com:
I sometimes see projects using servo's using the JAL servo llibraries. I have not yet used any servo's but I regularly have a project with LEDs that uses PWM (like the servo library). 
Iirc the servo library uses a timer to control up to 8 servo's, on any pin. Still a limited resource but not as restricted / inflexible as PWM pins.
 
A solution would be to use a PCA9685. There are modules available to control up to 16 servo's (or LEDs) using this module.
I was wondering if there are JAL users that have plans to use this device. If so I might make a library for it in some near future.
The PCA9685 is indeed easy to control via i2c. Intended for LEDs, but nowadays we have Neopixels and APA102C leds. The PCA9685 is also well suited for servo's if you have a proper power supply. 16 servo's draw a lot of current while moving or being loaded. A separate (step down) regulator for the servo's might prevent unintended resets of the pic.
 
Regards,
Joep

Rob CJ

unread,
Jan 16, 2022, 7:19:22 AM1/16/22
to jal...@googlegroups.com
Hi Joep,

I do know the WS2812 but the clock timing is critical  (I never understood why they made it like that) but I did not know these type of LEDs.

Thanks for the hint.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens jsu...@gmail.com <jsu...@gmail.com>
Verzonden: zondag 16 januari 2022 12:15
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Re: PWM library using a PCA9685?
 
--
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/598c415f-8bc4-4ed4-9cf2-31cd03d22315n%40googlegroups.com.

rob...@hotmail.com

unread,
Jun 5, 2022, 9:56:26 AM6/5/22
to jallist
Hi all,

Although not requested I made a JAL library for the PCA9685 16 channel 12-bit PWM IIC LED controller. You can also use it to control your servo.

I had no experience with servos so I thought let's give it a try using this library.  The library including some sample files have been uploaded to GitHub and will be in the next bee-package.

In order to promote JAL, I made a video and posted it on Youtube: https://www.youtube.com/watch?v=3R_2mupvRjM

Kind regards,

Rob

Op zondag 16 januari 2022 om 13:19:22 UTC+1 schreef rob...@hotmail.com:

Matthew Schinkel

unread,
Jun 5, 2022, 1:27:14 PM6/5/22
to jallist
Hi Rob, looks like a nice board.

We also have an i2c servo library if you want to use an external PIC to control additional servos.
18f4620_servo_rc_master_dedicated_master_i2c
18f4620_servo_rc_master_dedicated_slave_i2c

Matt.

Rob CJ

unread,
Jun 6, 2022, 1:13:26 AM6/6/22
to jal...@googlegroups.com
Hi Matt,

I know you created some nice servo libraries. I was just in the mood to create a new JAL library and since I have been doing some PWM projects and saw this device I thought it was a nice idea to make a library for it in case somebody want to use a lot of PWM channels.

And since it was a PWM device why not control a servo with it? Now I also knows how that works (including having a stuck servo that I had to release 🙂).

Kind regards,

Rob




Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Matthew Schinkel <mattsc...@hotmail.com>
Verzonden: zondag 5 juni 2022 19:27
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Re: PWM library using a PCA9685?
 
Reply all
Reply to author
Forward
0 new messages