Pages: [1]   Go Down
Author Topic: USBasp/V-USB no Atmega328p  (Read 1995 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Full Member
***
Karma: 1
Posts: 211
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 !!!!
« Last Edit: December 28, 2010, 08:27:35 am by nofxx » Logged

Pages: [1]   Go Up
Jump to: