[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Newbie - should this work?

From: Josh Thompson
Subject: [avr-gcc-list] Newbie - should this work?
Date: Fri, 17 Jan 2003 08:51:46 -0500
User-agent: Mutt/1.3.28i


I'm new at using working with embedded systems.  I am fairly familiar
with using gcc under Linux.  I am using an ATmega128, avr-gcc, and usip
with a ByteBlaster programmer.  uisp says it detects the chip and then
loads the code into flash.  I can dump the code and get the same thing
that I uploaded; so, I think this part is working okay.  Here is my code:

#include <io.h>

int main() {
   DDRD = 0xff;
   PORTD = 0X00;

all: main

main: main.c
   avr-gcc -D__AVR_ATmega128__ main.c -o main
   avr-objcopy --output-target=srec main main.srec

These are the steps I am taking:

./uisp -dprog=abb -dlpt=/dev/parport0 --upload if=main.srec

after this, I disconnect the programmer cable
disconnect power
reconnect power

At this point, I would expect to read 0 volts on the PORTD pins, but I
am reading 1.5 volts.

Should this work?  Am I following the right steps?

I have also tried it with 'PORTD = 0xff;' and still get 1.5 volts.

Thanks for your help,
avr-gcc-list at http://avr1.org

reply via email to

[Prev in Thread] Current Thread [Next in Thread]