Go Down

Topic: USBasp/V-USB no Atmega328p (Read 2482 times) previous topic - next topic

nofxx

Dec 28, 2010, 01:55 pm Last Edit: Dec 28, 2010, 02:27 pm by nofxx Reason: 1
Penei p/ brincar no 328, todos os exemplos são p/ 168, tomara q evite alguém perder horas ...:

Makefile:

MCU = atmega328p
BURNMCU = atmega328p
BURNPROGRAMMER = usbasp

CFLAGS += -Wall -gdwarf-2 -DF_CPU=16000000UL //.... (16mhz)

usbconfig.h:


#define USB_CFG_DMINUS_BIT      7 # usnoobie/duin
#define USB_INTR_VECTOR         INT0_vect

Upar um hex:

avrdude -c usbasp -p atmega328p -U flash:w:main.hex:i
Ignore warnings...

Pronto! Agora só alegria... o atmega pode ser qql HID!

Opcionais:

Usar a IDE:
/arduino-xxxx/hardware/arduino/boards.txt

usnoobie.name=MeuDuin (USnooBie/USBasp ATmega328P at 16MHz)
usnoobie.upload.protocol=usbasp
usnoobie.upload.maximum_size=28672
usnoobie.upload.speed=115200
usnoobie.upload.disable_flushing=true
usnoobie.bootloader.low_fuses=0xFF
usnoobie.bootloader.high_fuses=0xD8
usnoobie.bootloader.extended_fuses=0xFF
usnoobie.bootloader.path=usnoobie
usnoobie.bootloader.file=usnoobie_atmega328p_16mhz.hex
usnoobie.bootloader.unlock_bits=0x3F
usnoobie.bootloader.lock_bits=0x0F
usnoobie.build.mcu=atmega328p
usnoobie.build.f_cpu=16000000L
usnoobie.build.core=arduino


Eye candy:

/usr/share/hardware/usb.ids
E crie um vid/pid p/ ficar bonito seu device no lsusb! =P

Se vc tiver problemas com UDEV, crie um .rules:

SUBSYSTEM!="usb_device", ACTION!="add", GOTO="objdev_rules_end"
# USBasp
SYSFS{idVendor}=="16c0", SYSFS{idProduct}=="05dc", GROUP="users", MODE="666"
LABEL="objdev_rules_end"

SUBSYSTEMS=="usb", GROUP="users", MODE="0666"


PS.: Penei umas 7 horas, 6 delas tentando enviar o programa pra eeprom invés da flash e perdido pq ñ cabia mais de 2k! haha.
P/ efeitos de pesquisa:
avrdude: ERROR: address 0x0410 out of range at line 65 of main.hex
eeprom:w inves de flash:w !!!!

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy