Upload doesnt seem to work anymore

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Kars
 
Posts: 2
Joined: Fri Aug 14, 2009 12:34 pm

Upload doesnt seem to work anymore

Post by Kars »

Hey,

Im having trouble with my usbtiny kit. I just started with AVR's so i think im just doing something wrong
I have connected a LED to PB0 on my atmega 8
I flashed in a program that would turn whole port B high (1), so my led would turn on.
Everything worked fine as expecting

But then i wanted to turn off my LED, so i flashed in a program that would turn portB low (0), but my portB is staying high all of the time :?
Avrdude says i flashed my chip correctly, but it seems that my atmega8 wont accept the new program and just runs the old one

This is my avrdude 'reply'

Code: Select all

C:\Documents and Settings\Windows>avrdude -c usbtiny -p m8 -U flash:w:kars01.hex


avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x1e9307
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed

         To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "kars01.hex"
avrdude: input file kars01.hex auto detected as Intel Hex
avrdude: writing flash (74 bytes):

Writing | ################################################## | 100% 0.20s



avrdude: 74 bytes of flash written
avrdude: verifying flash memory against kars01.hex:
avrdude: load data flash data from input file kars01.hex:
avrdude: input file kars01.hex auto detected as Intel Hex
avrdude: input file kars01.hex contains 74 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.14s



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

avrdude: safemode: Fuses OK

avrdude done.  Thank you.
Somebody knows what's going on?

This is my led on and led off code:

Code: Select all

// LED ON
#include <avr/io.h>

int main(void)
{
  // Set Port B pins as all outputs
  DDRB = 0xff;

  // Set all Port B pins as HIGH
  PORTB = 0xFF;

  return 1;
}


// LED OFF
#include <avr/io.h>

int main(void)
{
  // Set Port B pins as all outputs
  DDRB = 0xff;

  // Set all Port B pins as LOW
  PORTB = 0x00;

  return 1;
}

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Upload doesnt seem to work anymore

Post by adafruit »

your usbtiny programmer works fine
which means you are having problems with either writing your code or compiling the right file or uploading the correct file

Kars
 
Posts: 2
Joined: Fri Aug 14, 2009 12:34 pm

Re: Upload doesnt seem to work anymore

Post by Kars »

You were right, it thought avrdude uploads from the "C:\" directory but it uploads from my "C:\Documents and Settings\<User>" directory :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”