PDA

View Full Version : Upload problems with Arduino Duemilanove!



cross1933
05-21-2009, 09:14 AM
My first attempt to upload a example sketch to the board was successful. My second attempt was to upload the loop sketch and connect a leds to Digital pins 1-7. Since this attempt the upload hangs with the TX led constantly flashing. The program hangs and I loose control functions, I have to make a forced closure of the program.

I removed the external bench top power supply and leds connected to digital outputs. Powered the board via the usb connection. Attempted to upload the 'loop" file, I get a constant flashing "TX" led and the program hangs?

jes1510
05-21-2009, 10:19 AM
Can you post your code here please? That'll help us help you.

cross1933
05-21-2009, 10:53 AM
I hooked the board up to a laptop. The errors that I received,

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x20

Here is the example sketch I am attempting to upload,

'Loop"

*
* Loop
* by David A. Mellis
*
* Lights multiple LEDs in sequence, then in reverse. Demonstrates
* the use of a for() loop and arrays.
*
* http://www.arduino.cc/en/Tutorial/Loop
*/

int timer = 100; // The higher the number, the slower the timing.
int pins[] = { 2, 3, 4, 5, 6, 7 }; // an array of pin numbers
int num_pins = 6; // the number of pins (i.e. the length of the array)

void setup()
{
int i;

for (i = 0; i < num_pins; i++) // the array elements are numbered from 0 to num_pins - 1
pinMode(pins[i], OUTPUT); // set each pin as an output
}

void loop()
{
int i;

for (i = 0; i < num_pins; i++) { // loop through each pin...
digitalWrite(pins[i], HIGH); // turning it on,
delay(timer); // pausing,
digitalWrite(pins[i], LOW); // and turning it off.
}
for (i = num_pins - 1; i >= 0; i--) {
digitalWrite(pins[i], HIGH);
delay(timer);
digitalWrite(pins[i], LOW);
}
}

cross1933
05-21-2009, 01:19 PM
Problem was that board selection was ATMEGA 168, this is a ATMEGA 328. :o

jes1510
05-21-2009, 01:22 PM
So, it's working now?

cross1933
05-22-2009, 06:44 AM
So, it's working now?

Its working but I need to modify the program to monitor the read back value?

jes1510
05-22-2009, 09:34 AM
Sorry but I don't understand exactly what it is you want to do now. Can you elaborate please?

cross1933
05-22-2009, 12:30 PM
Sorry but I don't understand exactly what it is you want to do now. Can you elaborate please?

I am testing a devantech SRF05 sensor to mount on my robot platform. I want to monitor the output from the Arduino board will I change the distance from the sensor to the test object.

Adrenalynn
05-22-2009, 12:37 PM
You would need to write a program to do that. The code you're running sets all pins as output...