LilyPad: I just want that LED to blink for me

Hi there,

So I got myself a nice shiny new LilyPad Arduino today, and am trying to get it hooked up and running. Obviously I'm posting here, which means it isn't working out. Forgive me if I'm overly thorough from here on out, but I've been at this for several hours, and had several other people attempt it and nobody got it right, so I'm assuming we're missing something either very small or ridiculously obvious. So, my setup is thus:

LilyPad Arduino-->LilyPad USB Link-->mini USB cable-->PC running Windows XP

I hooked the Arduino the USB Link in the way it was illustrated in the images on SparkFun and Leah Buechley's website. I can post a picture of the setup if that will help. In the Arduino software, my Board is set to LilyPad, and my com port is set to COM3, which is the port that got created when I plugged LilyPad in the first time. My baud rate is 9600.

When I plug everything in, the LED closest to pin 12 (tab 12? petal 12?) flashes three times quickly, then waits a bit and does it again, and so on. When I hit the reset button, that same triple strobe happens. So far, so good. I started up the Arduino software (the latest version, 10) and opened/compiled the "Blink" sketch. It compiles fine. Then I hit the reset button on the LilyPad and click "Upload to I/O Board" in the Arduino software. The LED near pin/tab/petal 12 continues its standby cycle, and then the software gives me the following error:

avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x42
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override this check.

Now, I suspect that this "use -F" business is important, but I have no idea what it means or how to use that information to my advantage. Regardless, here are the things I HAVE tried so far:

-switch computers: tried one Vista machine and two XP machines
-switch USB cables: tried two different ones
-uninstall/reinstall drivers: Uninstalled using Device Manager in one round, and using FT Clean in another round. Also tried downloading drivers from the FTDI website and pointing Windows to them, and downloading the executable from FTDI and using that.
-switch baud rate: I tried 9600 (the default) and 19200
-move LilyPad: I've had it sitting on my desk, my jeans, and a PSP case (checking to make sure it wasn't sitting on anything conductive). I also checked for conductive foam or wires or anything else that could be sitting on the board; nothing there.
-restart the machine: Tried restarting at various points in the install process, both with the LilyPad plugged in and without, and after driver installs or not
-Turn stuff off: disabled virus scanner and firewall, and unplugged my USB wireless adapter on the second XP machine

Okay, who has ideas for what I should do next? I've got a project due next Wednesday that I would love to use this LilyPad for, but if I can't get it running soon I'll have to abandon it. Any ideas/advice/help would be extremely appreciated. I will mail you cookies. Or, um, I don't know, send you nice jpg's of cookies, if giving your mailing address to some idiot grad student doesn't sound like a good idea :slight_smile: Anyway, THANK YOU in advance for your kind advice.

Hugs and Sparkles,
Cranky Grad Student
[timestamp=1204970858]

I can post a picture of the setup if that will help.

Extra information like that is often helpful.

I’ve noticed some people on here have solved some issues by swapping rx/tx signals, but I think that was with an Arduino mini connected.

–Phil.

do post a picture, a close up of the LilyPad & usb link would be great.

If you have a multimeter, plug your LilyPad into the usb link (keeping everything unplugged from your computer) & check to make sure that + on the lilypad is connected to + on the usb link, - to -, tx to rx & rx to tx. also just measure the resistance between + and - on the lilypad to make sure there's not a short somewhere.

did you try installing the FTDI drivers from the usb link sparkfun page?

Also, can you set upload.verbose to true in your Arduino preferences file (while Arduino isn't running), then run Arduino and try upload again, and post the output you get? It should include some debugging information that might help us figure out what's wrong.

Also, see the troubleshooting guide for general suggestions.

Wow, you guys are fast AND helpful! I'll try the multimeter and preferences file change suggestions when I get into the lab in a bit, but for now here is the photo you requested:

My Flickr set also has a closeup of the connection between the USB link and the LilyPad: fullshot | di.hughes | Flickr

THANK YOU!!

And, here is the response I get after setting upload.verbose to true:

avrdude: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

System wide configuration file is "C:\Documents and Settings\Administrator\Desktop\arduino-0010-win\arduino-0010\hardware/tools/avr/etc/avrdude.conf"

Using Port : \.\COM4
Using Programmer : stk500v1
Overriding Baud Rate : 19200
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Send: 0 [30] [20]
avrdude: Recv:
avrdude: Recv:
AVR Part : ATMEGA168
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
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 5 4 0 no 512 4 0 3600 3600 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


flash 65 6 128 0 yes 16384 128 128 4500 4500 0xff 0xff
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [81] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [98] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
Hardware Version: 2
Firmware Version: 1.16
avrdude: Send: A [41] . [84] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [85] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [86] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [87] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [89] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: Send: A [41] . [81] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: B [42] . [86] . [

It looks like the end of the output got cut off. Did it with the same error as before? Can you post the last part? Is there anything that's not in the post when you look at it? I think there should be more text after the lines that start "avrdude: Recv:".

In any case, it looks like the board and computer can communicate for a while - they're getting at least part way through the upload. Which makes it sound like something is partly loose or otherwise flakey, rather than being configured or connected wrong.

Hm, you're right. Looks like I exceeded the max characters allowed for one entry. Here's the rest:

Programmer Type : STK500
Description : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [81] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [98] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
Hardware Version: 2
Firmware Version: 1.16
avrdude: Send: A [41] . [84] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [85] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [86] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [87] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [89] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us

avrdude: Send: A [41] . [81] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: A [41] . [82] [20]
avrdude: Recv:
avrdude: Recv:
avrdude: Recv:
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [02] . [00] . [00] . [00] @ [40] . [00] [20]
avrdude: Recv:
avrdude: stk500_initialize(): (a) protocol error, expect=0x14, resp=0x42
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: Send: Q [51] [20]
avrdude: Recv:
avrdude: Recv:

avrdude done. Thank you.

You might try uploading from a Command Prompt. You'll need to cd into the main Arduino application directory and run the command line output when you upload in the IDE (it should be right above the messages you posted). Then, you can try slowing down the upload by adding a "-i 50" (without the quotes) to the end of the command line. That might help.

check the connections with your multimeter.

also try pressing down on the chip that's on the lilypad while you're uploading--this could reveal a bad solder joint on the chip connections...

I tried the multimeter, and as near as I can tell the connections are fine. A current goes from one end to the other on each.

Also tried pressing the chip, and still got the same errors.

I'm beginning to think I just got a dud board. Thoughts?

your error message is an unusual one. so I think this is a case where there could be something wrong with the board.

one last thing you could try if you have the equipment (which is sounds like you probably don't) is to reburn the bootloader on the lilypad. you need a programmer board to be able to do that...

You are correct; I lack the hardware for burning a bootloader. I'll talk to some EE folks and see if I can scrounge it, but my guess is that it isn't a possibility. At that point, we call the LilyPad a dud and ask SparkFun very nicely to let me return it. So I will take it from here, I guess.

THANK YOU everyone for your help! It's really great to discover that when I wander too far into ignorance land, there are people around to help me :slight_smile:

It seems like a small batch of LilyPad with corrupted bootloaders was sent out. This happened to some LilyPads that were sent out in the last month or so. We have restructured our testing process to make sure this does not happen again! If you think you have one of these bad LilyPads, get in touch with sparkfun about a replacement.

My sincerest apologies for this.

Leah