PCA9685 pulse GPIO pins

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
truxntrax
New user
Posts: 2
Joined: 17 Mar 2018, 14:44

PCA9685 pulse GPIO pins

#1 Post by truxntrax » 17 Mar 2018, 15:37

Hi,

I have purchased a PCA9685. I want to be able to pulse the output pins. I didn't notice in the wiki until the item has arrived that the instructions say:

Command Value Extra information
PCAPWM,<pin>,<value> 0...4095 Control PCA9685 pwm level.
PCFGPIO,<value> 1,0 Control PCF8574 output pins.
PCFPulse,<pin>,<value>,<duration> 1,0 Pulse control on PCF8574 output pins (duration in mS, MILLIseconds)
PCFLongPulse,<pin>,<value>,<duration> 1,0 Pulse control on PCF8574 output pins (duration in S, seconds)

I assumed that PCAPulse,<pin>,<value>,<duration> would work to pulse the pins... However I get a json error as follows:

Unknown or restricted command!

When I use: "PCF" and put my meter on the pin it remains at ~3v.
I've also tried setting one of the pins to 0 with:
PCFGPIO,<value>
http://192.168.1.145/control?cmd=PCFGPIO,11,0
I get the json conformation back that the pin has been set to 0:

{
"log": "GPIO 11 Set to 0",
"plugin": 19,
"pin": 11,
"mode": "output",
"state": 0
}

But when I put my meter accross the GND and V+ there is still ~3v.

Any idead what I am doing wrong? I can correctly adjust PWM from 0 to 4095 (using the yellow pwm pin on the PCA9685). I have wired the PCA9685 as follows:
GND to GND
OE to nothing
SCL to GPIO2 (d4)
SDA to GPIO0 (d3)
VCC to nothing
V+ 3V

Many thanks for any help!

John

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: PCA9685 pulse GPIO pins

#2 Post by Shardan » 17 Mar 2018, 15:49

Hm...
Did you mix up PCF8574 and PCA9685?

PCF8574 is a GPIO extender. It can do most things similar to the ESP's GPIOs, trigger a pulse of given length, set to on or off and so on.
It can be used as an input too.

PCA9685 is a PWM (Pulse width modulation) driver chip for LED's and PWM driven servos.
This chip generates it's own PWM signal independently from the ESP. Only the parameters
e.g. the pulse-duty factor for the PWM are sent from the ESP to the PCA9685 via I²C.

I don't think it is possible to send a single defined pulse from the PCA9685 as it is from the PCF8574 at all.

Regards
Shardan
Regards
Shardan

truxntrax
New user
Posts: 2
Joined: 17 Mar 2018, 14:44

Re: PCA9685 pulse GPIO pins

#3 Post by truxntrax » 17 Mar 2018, 16:18

Indeed, I think I have mixed up these two boards. I thought the PCA9685 could do what the PCF8574 could do and more...

I was checking before I ordered a PCF8574.

Oh well, should have read first, and bought second!

Thanks

John

TD-er
Core team member
Posts: 8751
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: PCA9685 pulse GPIO pins

#4 Post by TD-er » 17 Mar 2018, 18:55

truxntrax wrote: 17 Mar 2018, 16:18 [...]
Oh well, should have read first, and bought second!
[...]
You're still buying second ;)
(happens to all of us)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 111 guests