Page 1 of 1

PCA9685 Why not work?

Posted: Fri Aug 12, 2022 3:33 am
by niedian
PCA9685 Why not work? What went wrong? Please help me!
PCA9685.fcfx
PCA9685 Why not work?
(9.51 KiB) Downloaded 190 times

Re: PCA9685 Why not work?

Posted: Fri Aug 12, 2022 9:52 am
by BenR
Hello,

Please can you try this program instead.
PCA9685.fcfx
(8.67 KiB) Downloaded 180 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

Re: PCA9685 Why not work?

Posted: Sat Aug 13, 2022 1:09 am
by niedian
Still won't do.Can you give me an example? For example, light up LED0, LED3, etc.thank you!

Re: PCA9685 Why not work?

Posted: Sat Aug 13, 2022 7:09 am
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

Re: PCA9685 Why not work?

Posted: Sun Aug 14, 2022 12:46 pm
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

Re: PCA9685 Why not work?

Posted: Mon Aug 15, 2022 1:31 am
by niedian
PCA9685 (1).fcfx
(8.67 KiB) Downloaded 184 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 4049 times

Re: PCA9685 Why not work?

Posted: Mon Aug 15, 2022 5:56 am
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