Go Down

Topic: Connectionproblem between Arduino MEGA and adafruit-16-channel-pwm-servo-shield (Read 1 time) previous topic - next topic

htler007


HI.
I don't know why I can't drive the servos with the "adafruit-16-channel-pwm-slash-servo-shield". I'm using the software Arduino on my PC (Windows7). It's possible to upload the sketch "Blink" and it runs! But when I try to upload my own created sketch or "pwmtest" or "servo", the message :"avrdude: stk500v2_ReceiveMessage(): timeout", comes, and I also can see:" Done uploading", but the servos don't drive. It's funny that the message comes sometimes only once, sometimes twice and also sometimes NOT!
And this was crazy: One servo drove a little bit WHILE UPLOADING the sketch. What the hell was that?? XD But this happened only once.
The red LED for VCC lights and also the green one for V+.
I use a 470µF capacitor wich is correct soldered. The servo is correct connected.
The shield is connected with 5V, GND, SCL, SDA.
I also tried a sketch with wich i can send signals from an IRremoter to it's recceiver. The above message comes also, but it's possible to send signals to the recceiver, and the recceiver sends them to the microcontroller wich I can see by using the "Serial Monitor" function in Arduino.
I tried it also with Atmel Studio 6.1, but it still don't work despite of a correct run!
And i tried it also by using a laptop (Windows8). But it was also not possible to drive the servos with using Arduino or Atmel Studio 6.1.
I tried it also with an other Arduino MEGA 2560 without any success.
Thank you in advance.

john1993

the message :"avrdude: stk500v2_ReceiveMessage(): timeout", comes, and I also can see:" Done uploading"
its unfortunate that ide has a bug from the very first versions causing "upload done" message even if upload is not "done".  in fact maybe never even started.  quite often you have to turn on verbose mode and wade through the messages to see what really happened.  i suspect millions (yes, MILLIONS) of man hours wasted chasing tails because toolset designers ignore complaints.  same for avrdude utility.

sounds like hardware interference.  best course might be disconnect everything and see if errors then reconnect one at a time.

htler007


avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Arduino\hardware\tools\avr/etc/avrdude.conf"

         Using Port                    : COM8
         Using Programmer              : wiring
         Overriding Baud Rate          : 115200
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
         AVR Part                      : ATmega2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : Wiring
         Description     : Wiring
         Programmer Model: STK500
         Hardware Version: 2
         Firmware Version Master : 2.10
         Topcard         : Unknown
         Vtarget         : 5.0 V
         SCK period      : 8.7 us
         Varef           : 5.0 V
         Oscillator      : 14.400 kHz

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9801
avrdude: reading input file "C:\Users\KARIN&~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex"
avrdude: writing flash (1518 bytes):

Writing | ################################################## | 100% 0.25s

avrdude: 1518 bytes of flash written
avrdude: verifying flash memory against C:\Users\KARIN&~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex:
avrdude: load data flash data from input file C:\Users\KARIN&~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex:
avrdude: input file C:\Users\KARIN&~1\AppData\Local\Temp\build9c9ef3bdfe2fccb480bc6e4bac749e41.tmp/Blink.ino.hex contains 1518 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.19s

avrdude: verifying ...
avrdude: 1518 bytes of flash verified

avrdude done.  Thank you.




After pressing the RESET button, the LED is flashing in the way it should be, according to the sketch "Blink".

But as u see....the same message as before....but why?

john1993

looks like that timeout is just a harmless status indication and not an error.  if it appeared at the end and verify failed then maybe a concern but looks like download is ok.


unlike cheaper ebay clones which are properly designed the adafruit original lacks the big cap fix.  but you mentioned attaching one externally so unlikely a problem.  this should work. 

my experience with servo problems almost always due to power supply issues.  they can pull a lot specially transients on startup.  make sure supply is high current and use heavy wiring.  try only one servo for starters.  type of servos (2g, 5g, 9g, or more?), type of supply, and closeup photo of your setup might help.

if no scope you can also try replacing servo with led and waving around to see if there is a signal at all.

htler007

The servo will need 1.4A . That's what i have determined. According the datasheet, the max.current is 1.8A....maybe by virtue of the efficiency.
And yes, I know the wiring(1.5mm^2) of the servo power supply (6V) looks terrible. I gonna wire it better at School with using only 1mm^2 or so as wire cross section. I'm not sure if this is O.K. by drawing 10.8A peak value (according the datasheet), while driving 6 servos at the same time....

Using only brown wires is also a little bit disadvantageous, but I gonna change this also.
Nevertheless it's correctly wired.

 

 


john1993

yikes, BIG mf servos!  cant see the whole setup but does look ok.  beginning to look like software bug.  maybe trim the power leads a bit to minimize risk of short and check the signals coming out.  if no dvm with freq  or scope then plug in led and wave board around.  write simplest sketch for 1ms pulse and also one with 2ms pulse.  should be able to see the difference in dim light.

htler007

hey,
have good News
my sketch runs perfect^^
it was a missunderstanding by using the function for driving the servos

but thx for your help   ;)

Go Up