NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Microcontroller Programming » Getting started with 328P mcu (makefile setting using winavr)
August 07, 2010 by kle8309 |
Hey guys, I just bought a blank 328P and uploaded the NK 328P foodloader using avrisp stk500 but im not sure what to change in the makefile when trying to make a simple blinking led using the NK usb cable and WinAVR Note: I did tried on the atmega168 with the appropriate settings and it worked. Just this one doesn't. here is the makefile
OUTPUT from WinAVR
|
---|---|
August 07, 2010 by kle8309 |
Also, COM10 worked for atmega168 so lets assume that is out of the question |
August 07, 2010 by Rick_S |
I really don't see anything glaring wrong with what you did there. It appeared to compile fine, erase the chip, write the chip, then the chip doesn't verify. Did you set the fuses according to fuses_mike.txt in the bootloader328P folder? Another thing, I've had problems on occasion with the 168 object files left in the libnerdkits folder not being re-compiled for the 368. To ensure they do, delete the *.o files in the libnerdkits folder before compiling for the 368 for the 1st time. Rick |
August 07, 2010 by kle8309 |
rick,
about the fuses. I did tried to follow the fuses_mike.txt but was unable to set them in avr studio. All the high, low, and extended are the same but the lock bit is not. I used 0xef instead for lock bit.
Funny thing because when I 'read' a NK atmega168 chip w/ bootloader, the lock bits read was 0xef. That's how i got the idea of using 0xef for lockbits. |
August 07, 2010 by Rick_S |
Actually, I use AVRDude to program the fuse settings. On occasion I've used BASCOM-AVR (a basic compiler for AVR's) to set them. I do know once certain lock bits are set, a chip erase is all that will allow them to be changed. I ran into this when I purchased some 328's with the arduino bootloader. The only way to set the fuses and lock bits according to Mike's settings, I had to do a chip erase 1st. Also, the fuse settings for teh 328 are not the same as the 168 Rick |
August 07, 2010 by kle8309 |
ha ha yes I forgot about that. I thought of that when I was on the way home. Thanks I will try the new 328p settings |
August 07, 2010 by kle8309 |
Update, I got the 328P to work! the main reasons are the high and low fuse settings. Here is mike's: E: 0x05 H: 0xd2 L: 0xf7 LB: 0x2f Here is the best I could do with avr studio (it won't set otherwise): E: 0xf8 H: 0xd2 L: 0xf7 LB:0xef settings not according to mike's setting were chosen based on actual read from an atmega168 via avr studio. ps. Rick, is it safe to have both the NK usb cable and avrisp hooked up at the same time. |
Please log in to post a reply.
Did you know that our USB NerdKit works on Windows, Linux, and Mac OS X? Learn more...
|