|
|||||||
![]() |
Forum Index > General > Ask an Evil Mad Scientist! | ||
AVR programming methods |
|||
| | | Printable Version |
|
FIFTEEN54 | ||||||||
|
I have been using an Arduino Uno to prototype various projects, breadboard style, then building barebones boards to program and implement. I have recently decided to start using blank ATmega328 with the EMSL target boards. This opened up a can of worms because now I find my self playing with AVRdude and Xcode. AVRdude is fine however, Xcode seems to be overcomplicated for what I am trying to achieve. Like using a laser chain-saw that harnesses the power of 3 stars to toast half a bagel. This leads me to my question, what is the easiest way to program via ISP? Should I just burn the Arduino bootloader onto the blank ATmega and modify one of my USB-BUBs with some pico-hook ends to get to pins 2 and 3? Is there a way to just keep with the easy to use Arduino environment and use USBtinyISP and call it a day? |
![]() Apprentice ![]() Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
>This opened up a can of worms because now I find my self playing with AVRdude and Xcode. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
Thanks, that cleared that right up. |
![]() Apprentice ![]() Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
Hey, another problem has reared its head, I edited the preferences.txt file to use the usbtinyisp to flash sketches directly to the micros and I receive this error: USB write error: expected 128, got -1avrdude: verification error, first mismatch at byte 0x00ef 0x92 != 0xa9 avrdude: verification error; content mismatch
|
![]() Apprentice Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
I'm afraid that I'm not familiar with this problem or resolution; I suggest that you try searching the Arduino forums for the solution. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
Actually, one thing to check: You *do* have a crystal on these boards, right? Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
Yes, one has a legit crystal and the other one has a resonator. I have also found the temp .hex file created by the Arduino IDE and tried to upload using AVRDUDE directly but no dice. I have been scouring the internet tirelessly and that error seems to be a device permissions problem. I am now trying to find that configuration file and edit it, but alas mac only similar to linux so I have no idea what file that is... So really this is turning in to a mac configuration issue... |
![]() Apprentice Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
>I have been scouring the internet tirelessly and that error seems to be a device permissions problem Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
Yes, I tried that, not so much. Every function fails for the same reason... not only on my imac but on my macbook as-well... I am beginning to think this could be my programmer.... |
![]() Apprentice Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
> I am beginning to think this could be my programmer.... Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
Results: $ avrdude -c usbtiny -p m328p -B 5 -V -e -U lock:w:0x3F:m -U hfuse:w:0xDF:m -U lfuse:w:0xFF:m -U efuse:w:0xF8:mavrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e950f avrdude: erasing chip avrdude: reading input file "0x3F" avrdude: writing lock (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lock written avrdude: reading input file "0xDF" avrdude: writing hfuse (1 bytes): Writing | ################################################## | 100% 0.01s avrdude: 1 bytes of hfuse written avrdude: reading input file "0xFF" avrdude: writing lfuse (1 bytes): Writing | ################################################## | 100% 0.00s avrdude: 1 bytes of lfuse written avrdude: reading input file "0xF8" avrdude: writing efuse (1 bytes): Writing | | 0% 0.00s ***failed; Writing | ################################################## | 100% 0.04s avrdude: 1 bytes of efuse written avrdude: safemode: efuse changed! Was f8, and is now 0 Would you like this fuse to be changed back? [y/n] n avrdude: safemode: Fuses OK avrdude done. Thank you.
$ avrdude -c usbtiny -p m328p -B 1 -V -D -U flash:w:/applications/arduino.app/contents/resources/java/hardware/arduino/bootloaders/optiboot/optiboot_atmega328.hex:iavrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f avrdude: reading input file "/applications/arduino.app/contents/resources/java/hardware/arduino/bootloaders/optiboot/optiboot_atmega328.hex" avrdude: writing flash (32748 bytes): Writing | | 0% 0.00s avrdude: error: usbtiny_send: usb_control_msg(DeviceRequestTO): unknown error (expected 128, got -1) Writing | ################################################## | 100% 0.07s avrdude: failed to write flash memory, rc=-1 avrdude: safemode: Fuses OK avrdude done. Thank you.
|
![]() Apprentice Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
set the extended fuse to 0x00. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
There is no error now when I write to the fuse blocks but I still get the same error when burning the bootloader... |
![]() Apprentice Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
Windell | ||||||||
|
>There is no error now when I write to the fuse blocks but I still get the same error when burning the bootloader... Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Evil Scientist ![]() Status: offline
Registered: 06/15/06 |
||||||||
|
|||||||||
|
FIFTEEN54 | ||||||||
|
Just as an update, it was indeed a clocking issue. "-B 155 " seems to be the sweet spot. I am now successfully writing to flash but sketches don't seem to work. Still tinkering with it... Thanks for all the help Windell. |
![]() Apprentice Status: offline
Registered: 02/17/11 |
||||||||
|
|||||||||
|
|
| All times are PDT. The time is now 06:12 AM. |
|
|
Octolively
Interactive LED kits
Meggy Jr RGB
LED matrix game
development kit.
Business-card sized
AVR target boards
Peggy 2
LED Pegboard kits