PCA9685 Why not work?

Post and discuss new components that you have created.
Post Reply
niedian
Posts: 83
http://meble-kuchenne.info.pl
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

PCA9685 Why not work?

Post by niedian »

PCA9685 Why not work? What went wrong? Please help me!
PCA9685.fcfx
PCA9685 Why not work?
(9.51 KiB) Downloaded 187 times

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: PCA9685 Why not work?

Post by BenR »

Hello,

Please can you try this program instead.
PCA9685.fcfx
(8.67 KiB) Downloaded 177 times
If you're still getting nothing then I suggest doing the 1 second flasher test using a LED as documented here to ensure your microcontroller is programmed and running correctly.

https://www.flowcode.co.uk/wiki/index.p ... ED_flasher

niedian
Posts: 83
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

Re: PCA9685 Why not work?

Post by niedian »

Still won't do.Can you give me an example? For example, light up LED0, LED3, etc.thank you!

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 397 times

Re: PCA9685 Why not work?

Post by chipfryer27 »

Hi

You appear to have posted the same question in the v8 forum (which I answered) before posting in v9.

Have you done as Ben suggested and tried a one-second flasher? You cannot overestimate the importance of this test to ensure settings etc are correct.

Assuming the flash test works then

Check connections from microcontroller to the module. You only need four connections, Ground (0v), SDA, SCL and +5v.
Check module address. You are using default of 0x40 so make sure there are no solder splashes across any address pads.
Check power to the module. You need to provide Ground (0v) and +5v from a supply to the terminal block on the module.
If controlling an LED then your Output will be PWM and GND of whatever channel you selected. Your code has channel 3 as output so that will be the fourth output from left (channels 0 - 15)
Check polarity of your output LED and remember that the maximum output draw per pin is 25mA.

Regards

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 397 times

Re: PCA9685 Why not work?

Post by chipfryer27 »

Hi

I have just verified that the code I provided in another post, and that of Ben's work just fine. If you still cannot get your code to work you will need to provide more specific details, especially with regards to the results of the "flash test" and connections.

Regards

niedian
Posts: 83
Joined: Thu Jan 07, 2021 11:28 am
Has thanked: 3 times
Been thanked: 4 times

Re: PCA9685 Why not work?

Post by niedian »

PCA9685 (1).fcfx
(8.67 KiB) Downloaded 181 times
Ran the simulation according to your program, and it still doesn't work. Can you send up the LED flashing program you made? thank you
simulation.jpg
simulation.jpg (130.17 KiB) Viewed 3977 times

chipfryer27
Valued Contributor
Posts: 1110
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 278 times
Been thanked: 397 times

Re: PCA9685 Why not work?

Post by chipfryer27 »

Hi

I do not use Proteus so cannot help with your simulation.

However the code I provided in your original post (v8 forum) has been verified to work in hardware.

Regards

Post Reply