PowerSwitch atmega8

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
dk

PowerSwitch atmega8

Post by dk » Fri Mar 14, 2008 4:34 pm

i want to compile the powerswitch projekt for a atmega8.

i changed in usbconfig.h the lines
#define USB_CFG_IOPORTNAME D
#define USB_CFG_DMINUS_BIT 6
#define USB_CFG_DPLUS_BIT 7

and the makefile
DEVICE = atmega8

what else have i to do?

i´m using the USBasp programmer and AVR studio4

dk

Post by dk » Mon Mar 17, 2008 2:05 am

please give me just a little todo list for a succesfull hex file.

mirecta

Re: PowerSwitch atmega8

Post by mirecta » Mon Mar 17, 2008 10:11 am

D+ or D- must be connected to INT0


dk wrote:i want to compile the powerswitch projekt for a atmega8.

i changed in usbconfig.h the lines
#define USB_CFG_IOPORTNAME D
#define USB_CFG_DMINUS_BIT 6
#define USB_CFG_DPLUS_BIT 7

and the makefile
DEVICE = atmega8

what else have i to do?

i´m using the USBasp programmer and AVR studio4

dk

Post by dk » Mon Mar 17, 2008 12:26 pm

D+ is connected to INT0/PD2

i´m not sure. should this hex file work?

Code: Select all

C:\firmware>make
avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8  -c usbdrv/usbdrv.c -o usbdrv/usbdr
v.o
In file included from usbdrv/usbdrv.h:13,
                 from usbdrv/usbdrv.c:16:
./usbconfig.h:252:38: warning: no newline at end of file
avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8  -x assembler-with-cpp -c usbdrv/us
bdrvasm.s -o usbdrv/usbdrvasm.o
In file included from usbdrv/usbdrv.h:13,
                 from usbdrv/usbdrvasm.s:27:
./usbconfig.h:252:38: warning: no newline at end of file
avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8  -c usbdrv/oddebug.c -o usbdrv/odde
bug.o
avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8  -c main.c -o main.o
In file included from usbdrv/usbdrv.h:13,
                 from main.c:17:
./usbconfig.h:252:38: warning: no newline at end of file
main.c: In function 'main':
main.c:145: warning: large integer implicitly truncated to unsigned type
avr-gcc -Wall -Os -Iusbdrv -I. -mmcu=atmega8  -o main.bin usbdrv/usbdrv.o usbdrv
/usbdrvasm.o usbdrv/oddebug.o main.o
rm -f main.hex main.eep.hex
avr-objcopy -j .text -j .data -O ihex main.bin main.hex
./checksize main.bin
C:\firmware\checksize: awk: command not found
C:\firmware\checksize: [: -gt: unary operator expected
ROM:  bytes (data=)
C:\firmware\checksize: [: -gt: unary operator expected
RAM:  bytes

C:\firmware>

Post Reply