Asked — Edited
Resolved Resolved by Athena AI!

Can ARC Work With An Lattepanda/Arduino With A PCA9685 Connected To It?

Can ARC work with a Lattepanda's Arduino with DJ's firmware installed with a PCA9685 connected to it to control servo's in the following connection model?  Note UNO represents the Lattepanda's Arduino GPIO.

User-inserted image

I would be connecting to pin 6 for A4 and pin 8 for A5

User-inserted image

Will the standard servo skills work in ARC if ARC is connected to the Arduino or is something else needed? Like the PCA9685 16-Channel PWM Driver Module Library loaded on the the Arduino?


Related Hardware LattePanda

ARC Pro

Upgrade to ARC Pro

Take control of your robot's destiny by subscribing to Synthiam ARC Pro, and watch it evolve into a versatile and responsive machine.

#2   — Edited

This post did not have any relevant information so I removed it.

PRO
USA
#3   — Edited

Yes, I modified the Mick's software and loaded it to my "Arduino uno", and it worked just fine with all the info above. You did watch the video? I used it with the ESP32

I put : // Creat object to represent PCA9685 at default I2C address Adafruit_PWMServoDriver pca9685 = Adafruit_PWMServoDriver(0x40);

Try loading Mick's software to an Arduino  "as is".

I not using a Lattepanda , but The instruction say: download the Arduino firmware below. You can program on the Arduino Leonardo that's built into the LattePanda. Adding this firmware lets you connect ARC to the local Arduino and directly control the GPIO.

DJ's instructions - Download Arduino Leonardo Firmware: EZ-Genuino_Leonardo.zip. Last updated 2022/08/24

I just used my Arduino uno with Micky's software modified, compile fine, I don't have my PCA 9685 here so I can't use it here at the farm, but I know it works

Most Arduino have a SDA or SCL

User-inserted image

Remember - Nothing would move until I added a separate 5 to 7.5 v power supply, I use on the PCA 9685 above

#4   — Edited

Removed as no longer correct

PRO
USA
#5  

did you get it to work yet?

#6  

I have not tried it yet I need to pull the Lattepanda out of my V1 head first and setup some type of test bed for it.  Space is a bit of an issue for me at the moment.

PRO
USA
#7  

Sounds good,

I just tested the Arduino uno (with the Arduino code) and the PCA9685 with just 8 servos, as you can see, it works well

PRO
USA
#8  

thanks, smiller29 for the email

Your community post was liked by smiller29.

#9  

Well,  I finally got a chance to try this on the Lattepanda's Arduino and got the following error so I don't know if anyone can help me with this.

Arduino: 1.8.13 (Windows 10), Board: "Arduino Leonardo"











C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino:68:1: warning: narrowing conversion of '38400' from 'long int' to 'int' inside { } [-Wnarrowing]
 };
 ^
C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino:68:1: warning: narrowing conversion of '57600' from 'long int' to 'int' inside { } [-Wnarrowing]
C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino:68:1: warning: narrowing conversion of '115200' from 'long int' to 'int' inside { } [-Wnarrowing]
C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino:68:1: warning: overflow in implicit constant conversion [-Woverflow]
C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino:68:1: warning: narrowing conversion of '115200' from 'long int' to 'int' inside { } [-Wnarrowing]
C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino:68:1: warning: overflow in implicit constant conversion [-Woverflow]
C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino: In function 'void doEZProtocol()':
EZ-Genuino_Uno_Adafruit_16_Servo_Shield:276:35: error: call of overloaded 'write(int)' is ambiguous
         COMMUNICATION_PORT.write(0);
                                   ^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:234:0,
                 from sketch\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/USBAPI.h:105:17: note: candidate: virtual size_t Serial_::write(uint8_t)
  virtual size_t write(uint8_t);
                 ^~~~~
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
                 from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,
                 from sketch\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino.cpp:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:52:12: note: candidate: size_t Print::write(const char*)
     size_t write(const char *str) {
            ^~~~~
exit status 1
call of overloaded 'write(int)' is ambiguous


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

#11   — Edited

Removed as no longer correct.

#12  

Using the new Arduino IDE 2.0.3 the new firmware compiled ok but when sending it to the Lattepanda I got the following feedback on the screen.

Connecting to programmer: .
Found programmer: Id = "CATERIN"; type = S
    Software Version = 1.0; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=128 bytes.

Programmer supports the following devices:
    Device code: 0x44

I am not sure this is an issue or not.

Using Arduino IDE 1.8.13 there does not seem to be an issue uploading the new Arduino Leonardo Dec 11th firmware.

#13  

DJ,  When trying to compile Mickey's package I am still getting the following error.

Arduino: 1.8.13 (Windows 10), Board: "Arduino Leonardo"











C:\Users\LattePanda\Downloads\EZ-Genuino_Uno_Adafruit_16_Servo_Shield-636873415224574009\EZ-Genuino_Uno_Adafruit_16_Servo_Shield\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino: In function 'void doEZProtocol()':
EZ-Genuino_Uno_Adafruit_16_Servo_Shield:276:35: error: call of overloaded 'write(int)' is ambiguous
         COMMUNICATION_PORT.write(0);
                                   ^
In file included from C:\Users\LattePanda\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:234:0,
                 from sketch\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino.cpp:1:
C:\Users\LattePanda\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/USBAPI.h:105:17: note: candidate: virtual size_t Serial_::write(uint8_t)
  virtual size_t write(uint8_t);
                 ^~~~~
In file included from C:\Users\LattePanda\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Stream.h:26:0,
                 from C:\Users\LattePanda\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/HardwareSerial.h:29,
                 from C:\Users\LattePanda\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:233,
                 from sketch\EZ-Genuino_Uno_Adafruit_16_Servo_Shield.ino.cpp:1:
C:\Users\LattePanda\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Print.h:52:12: note: candidate: size_t Print::write(const char*)
     size_t write(const char *str) {
            ^~~~~
exit status 1
call of overloaded 'write(int)' is ambiguous


This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This package also has SendOnlySoftwareSerial.ccp and SendOnlySoftwareSerial.h which I think your firmware is also using.  So I am not sure what to do here any help would be great.   I really was counting on using this Adafruit 16 channel servo shield with the Lattepanda in the head.

PRO
Synthiam
#14   — Edited

Sorry, what do you mean by "mickey's package"? I provided a link to the Leonardo ezb firmware. You responded to this issue in some random thread, so I'm not sure what page or firmware you're talking about. Do you have a link, screenshot, or something that can help me?

#17   — Edited

DJ,  I compiled the package you created and uploaded it to the Lattepanda.  When I set it up in ARC using 57600 Baud with RTS checked and setup the Vertical servo control when I go to pick the port it show a picture of the PCA9685 and I set port 1 which is the port on the board I am using I get no servo Movement.

User-inserted image

I connected GND to 23 and VCC to Pin 24.  SDA was to Pin 6 and SCL was to Pin 8.  Note also tried these on Pins 17=A4,19=A5 had the same issue.

User-inserted image

User-inserted image

The following is a video of what happening when I move the value in the servo control in ARC

https://www.youtube.com/shorts/cBHq1bp8d7Q

#19   — Edited

DJ Yes I did to the letter.   But I have to tell you his changes don't make sense to me.  Because nowhere else in the code are you using pca9685

#20  

DJ, this post was in the right place under "16 servo Shield by Adafruit"  What I was asking was because your "EZ-Genuino_Uno_Adafruit_16_Servo_Shield.zip (Dec 11, 2022)" firmware looks to be based off of the same code in the "EZ-Genuino_Leonardo.zip (updated Dec 11, 2022)" firmware that has dummy code for Serial1 and Serial2 for defensive coding if it should be added to the "EZ-Genuino_Uno_Adafruit_16_Servo_Shield.zip (Dec 11, 2022)" to make it more robust.

Also your "EZ-Genuino_Uno_Adafruit_16_Servo_Shield.zip (Dec 11, 2022)" firmware does not work for port 0 and Port 1 on the controller because you have: #define _PortStart 2  and it should be #define _PortStart 0

I had attach the zip file with my changes to the other post for your review.  If you don't feel I am right it's all good was just trying to help.

#21   — Edited

Removed as no longer needed.

#22  

Here are the changes I posted in the other post for your review.

EZ-Genuino_Uno_Adafruit_16_Servo_Shield-SMM.zip

I removed a few of my comments in the other post because it is clear people did not understand them.  I hope at this point you are clear on what I was trying to convey to you.

PRO
Synthiam
#23  

Good work getting your pca9685 (not the supported Adafruit board) working. I'll post the code. I won't name it 16-channel adafruit as it uses a generic controller and not the adafruit version - it might help others with generic knockoffs as well

#24  

I am happy we are on the same page now.  Just a note I also tested this on the Lattepanda and it also works.