CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Tue Oct 15, 2019 2:46 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Adafruit PCA9685 issues
PostPosted: Sat Feb 13, 2016 2:16 am 
Offline

Joined: Thu Feb 11, 2016 4:06 am
Posts: 38
I am playing with a pi2 and the PCA9685 16 channel pwm board from adafruit. i have a led across pwm and grd of the channels. i cant get them to increase or decrease intensity.
i have no jumpers on the board for the address. i have the address in codesys for this board set to 0 and the freq set to 50. i've adjusted the array values of Adafruit_PWM.alrPWM[0] from 0 to 4096 without any changes. any ideas what im doing wrong? how do i know the board is even connected? the green light is on.


Top
   
PostPosted: Sat Feb 13, 2016 4:40 am 
Offline

Joined: Thu Feb 11, 2016 4:06 am
Posts: 38
ok i managed to figure out that the address needs to be set to 0 when the address isn't set on the pwm board. you also need to set the axEnable bit high that corresponds to the channel you are adjusting.

i just cant seem how to get the led to go bright and dim out. i can only manage to adjust the brightness slightly. ive tried adjusting from 0 to 1 and 0 to 4096...any idea?


Top
   
PostPosted: Sat Feb 13, 2016 6:53 am 
Offline

Joined: Thu Feb 11, 2016 4:06 am
Posts: 38
I downloaded the device description and library for the PCA9685 created by moderator3S found here http://forum.codesys.com/viewtopic.php?f=23&t=5872

I cant use it cause I get all kinds off library errors which I cant figure out.

How do I get this device working correctly


Top
   
PostPosted: Sun Feb 14, 2016 5:47 pm 
Offline

Joined: Wed Jan 20, 2016 6:31 pm
Posts: 15
I have used it with a rc servo and it worked OK on PI2 withe the standard library that is provided with the PI package for Codesys.
You probably get library errors because the library that You downloaded was made for earlier version of Codesys.
Try to open the library file with Codesys, update it when Codesys asks and then try again. But the update may be also impossible - I think that I saw somewhere that the library code handling raspberry peripherals was changed in some version...


Top
   
PostPosted: Mon Feb 15, 2016 2:05 pm 
Offline

Joined: Thu Feb 11, 2016 4:06 am
Posts: 38
so i had issues with the original files to run the Adafruit 16 channel pwm boards. I then decided to use the files from moderator3s on this forum. after having library errors and screwing around with that for a few hours, i managed to get the first board dimming leds as required.
i now added a second same board to the ic2 channel, added the A0 jumper, changed the address in the plc to 1 and now this one wont show it as running....arg!


Top
   
PostPosted: Mon Feb 15, 2016 5:19 pm 
Offline

Joined: Thu Feb 11, 2016 4:06 am
Posts: 38
OK think I figured it out. Seems the Address for these boards start at 64 decimal. So with no jumpers the address is 64 dec, when I add a jumper to A0 on the board the address in codesys becomes 65 dec


Top
   
PostPosted: Mon Feb 15, 2016 6:55 pm 
Offline

Joined: Wed Jan 20, 2016 6:31 pm
Posts: 15
If You look at the library code You will see that it automatically sets address specified as 0 to the right one (when without jumpers), but it doesn't change it when the address is different than 0...


Top
   
PostPosted: Wed Apr 04, 2018 8:56 am 
Offline

Joined: Wed Mar 28, 2018 3:12 pm
Posts: 30
johnfarrugia wrote:
so i had issues with the original files to run the Adafruit 16 channel pwm boards. I then decided to use the files from moderator3s on this forum. after having library errors and screwing around with that for a few hours, i managed to get the first board dimming leds as required.
i now added a second same board to the ic2 channel, added the A0 jumper, changed the address in the plc to 1 and now this one wont show it as running....arg!


Hy, I'm using the same board, but compiler says "failed to insert library..." how do you changed the library?
Does it is possible for you to insert correct library here? thanks

Massimo


Top
   
PostPosted: Fri Apr 06, 2018 10:39 am 
Offline

Joined: Wed Mar 28, 2018 3:12 pm
Posts: 30
I fixed all error in Library. I would like to use this chip as digital output, not pwm.
I use PCA9685.axEnable with an 'array [0..15] of bool' to set PWM output channel. I don't understand how to set the pwm value for single exit pin or how to turn ON/OFF single exit bit.

Can you help me?
Thanks


Top
   
PostPosted: Mon Apr 23, 2018 9:55 pm 
Offline

Joined: Thu Mar 29, 2018 8:01 pm
Posts: 3
Hi
I use Raspberry Pi3 with newest Codesys V3.5 SP12 Patch 2. I updated all librarys.
I try to make communication witch Adafruit PWM pcb, using Adafruit PWM library and servo connected to channel 0. I don't use any shortcircuit in address pads.
I open I2C example, compile and send to RPi, and nothing- servo doesnt run. In next step, I open SoftMotion Servo Example, compile and send to RPi and servo is running. But I don't understand how this program refer to Adafruit PWM library.

Could anybody can send, working example for RPi3, for servo connected to channel 0 (FBD will be best).

Thanks for any response.
Best regards.

Łukasz


Top
   
PostPosted: Wed Apr 25, 2018 8:20 am 
Offline

Joined: Thu Mar 29, 2018 8:01 pm
Posts: 3
ŁukaszPowała wrote:
Hi
I use Raspberry Pi3 with newest Codesys V3.5 SP12 Patch 2. I updated all librarys.
I try to make communication witch Adafruit PWM pcb, using Adafruit PWM library and servo connected to channel 0. I don't use any shortcircuit in address pads.
I open I2C example, compile and send to RPi, and nothing- servo doesnt run. In next step, I open SoftMotion Servo Example, compile and send to RPi and servo is running. But I don't understand how this program refer to Adafruit PWM library.

Could anybody can send, working example for RPi3, for servo connected to channel 0 (FBD will be best).

Thanks for any response.
Best regards.

Łukasz


Hi

Is anybody could help me with using Adafruit PWM and Raspberry Pi 3 in Codesys?

Łukasz


Top
   
PostPosted: Thu May 31, 2018 12:53 pm 
Offline

Joined: Wed Mar 28, 2018 3:12 pm
Posts: 30
elconfa wrote:
I fixed all error in Library. I would like to use this chip as digital output, not pwm.
I use PCA9685.axEnable with an 'array [0..15] of bool' to set PWM output channel. I don't understand how to set the pwm value for single exit pin or how to turn ON/OFF single exit bit.

Can you help me?
Thanks


Does anyone use this chip as a simple digital output?
Thanks


Top
   
PostPosted: Fri Jul 06, 2018 2:34 pm 
Offline

Joined: Wed Mar 28, 2018 3:12 pm
Posts: 30
Does anyone use this chip as a simple digital output?
How to set the ouput high or low?
Please
Thanks


Top
   
PostPosted: Thu Apr 25, 2019 5:16 pm 
Offline

Joined: Tue Apr 16, 2019 5:12 pm
Posts: 5
ŁukaszPowała wrote:
Hi
I use Raspberry Pi3 with newest Codesys V3.5 SP12 Patch 2. I updated all librarys.
I try to make communication witch Adafruit PWM pcb, using Adafruit PWM library and servo connected to channel 0. I don't use any shortcircuit in address pads.
I open I2C example, compile and send to RPi, and nothing- servo doesnt run. In next step, I open SoftMotion Servo Example, compile and send to RPi and servo is running. But I don't understand how this program refer to Adafruit PWM library.

Could anybody can send, working example for RPi3, for servo connected to channel 0 (FBD will be best).

Thanks for any response.
Best regards.

Łukasz



Could you do it?


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 14 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited