Go Down

Topic: Optiboot Atmega 88 16mhz works fine, no luck with 8mhz@3v3 (Read 2 times) previous topic - next topic

Sadders

Apr 14, 2011, 04:17 am Last Edit: Apr 25, 2011, 09:02 pm by Sadders Reason: 1
Hi
Well i'v built 1 atmega88 16mhz 5v based on sparks mini pro. Bad picture, looks much better in person and smaller ...honest :)

Well having no luck compiling http://code.google.com/p/optiboot/source/browse/#hg%2Foptiboot%2Fbootloaders%2Foptiboot
Code: [Select]
D:\WinAVR-20100110\optiboot\New folder>make atmega88
makefile:328: *** target pattern contains no `%'.  Stop.


I've nearly completed 8mhz 3v3 so that would be next 'help' i'll need :)

Thanks, Phil





Sadders

Well appear to be getting closer.
Found http://www.neonile.com/tutorials/19-electronics-and-robotics/196-atmega8-arduino-bootloader
For which got optiboot source downloaded and i'm able to compile everything but Atmega 88
Code: [Select]
D:\WinAVR-20100110\optiboot\optiboot\bootloaders\optiboot>make atmega88
avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-c
alls -mmcu=atmega88 -DF_CPU=16000000L   '-DLED_START_FLASHES=3' '-DBAUD_RATE=115
200'   -c -o optiboot.o optiboot.c
avr-gcc -g -Wall -Os -fno-inline-small-functions -fno-split-wide-types -mshort-c
alls -mmcu=atmega88 -DF_CPU=16000000L   '-DLED_START_FLASHES=3' '-DBAUD_RATE=115
200' -Wl,--section-start=.text=0x3e00 -Wl,--relax -nostartfiles -Wl,--gc-section
s -o optiboot_atmega88.elf optiboot.o
d:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: address
0x3ffa of optiboot_atmega88.elf section .text is not within region text
d:/winavr-20100110/bin/../lib/gcc/avr/4.3.3/../../../../avr/bin/ld.exe: address
0x3ffa of optiboot_atmega88.elf section .text is not within region text
make: *** [optiboot_atmega88.elf] Error 1
rm optiboot.o


So any thoughts ??

Thanks,Phil

Sadders

well tried un-install/install of winavr still no joy.

Sadders

update so far:

Well i got bootloader running and could upload using Uno without p328 fitted. All fine and good.
But couldn't use my at90usb162 usb>serial just wouldn't talk.
Tried millions of thing ie fixed it till it broke :) Till finally i cut off mcu and put another on but didn't change anything !!! Bugger. Turned out dragon was at fault...doh.
Well i didn't notice but AVR dragon started to have a problem using ISP. At first thought my fault then pcb everything other but dragon. (if you own one and don't know READ this http://www.aplomb.nl/TechStuff/Dragon/Dragon.html) Simple fix little dirty once broken, still working again now.

Well where i'm at.
Well i can compile code no errors. I found adding
Code: [Select]
atmega88: LDSECTION  = --section-start=.text=0x1e00

Now this is one problem i have. I just can't remember what worked.
Boot flash size 256 words boot address=$0f00
which $0f00(word)*2=0x1e00


Code: [Select]
# ATmega88
atmega88: TARGET = atmega88
atmega88: MCU_TARGET = atmega88
atmega88: CFLAGS += '-DLED_START_FLASHES=3' '-DBAUD_RATE=115200'
atmega88: AVR_FREQ = 16000000L
atmega88: LDSECTION  = --section-start=.text=0x1e00
atmega88: $(PROGRAM)_atmega88.hex
atmega88: $(PROGRAM)_atmega88.lst
atmega88_isp: atmega88
atmega88_isp: TARGET = atmega88
atmega88_isp: MCU_TARGET = atmega88
# 2.7V brownout
atmega88_isp: HFUSE = DD
# Low power xtal (16MHz) 16KCK/14CK+65ms
atemga88_isp: LFUSE = FF
# 512 byte boot
atmega88_isp: EFUSE = 04
atmega88_isp: isp


And other problem i have 'Fuses'
I have EXT=0xFC High=0xDD Low=0xFF . 04 EXT/efuse just wouldn't take in studio.
Lockbit=0xCF  LPM/SPM locked other s all open.
I'm using AVR Studio to flash+dragon. When i use avrdude+ 'make atmega88_isp' Get error from 'atmega88_isp: HFUSE = DD' coming out as '0x' on verify.
I've read so much totaly lost as to what right.

Well i did try and make sure hardware was working and as much as i can tell its fine :)
Used isp to upload blinky and something for serial out put. I can read TX line in IDE using uno.

Thanks, Phil




Sadders

Hi

Well still no luck understanding whats going wrong for me.

Kind thinking something about my setup must be wrong?
And kinda surprised at no comments, have i done something wrong?


Phil

westfw


There's a typo in the makefile on the LFUSE line for mega88:
Code: [Select]
atemga88_isp: LFUSE = FF
it should read
Code: [Select]
atmega88_isp: LFUSE = FF



I dug out the atmega88's I bought a while ago for purposes of exploring non-standard cpus.  It turns out that they're the atmega88pa version, so I had additional signature issues because the avrdude distributed with arduino does not know about the 88p.  But after that, and fixing the typo above, and fixing the section_start issue that you found, I was able to burn a bootloader using "make atmega88_isp", got blinking lights on reset, and was able to upload and run sketches...

Sadders

Hi

Thanks for that, typo was a pain. I could change it but ended up Ultraedit to open it then copy&paste into notepad. Changed it a little and added 8mhz (hope got fuses right).

Boards.txt only other think i'm really unsure about
Code: [Select]
atmega88o.name=[Optiboot] Arduino NG or older w/ ATmega88 16Mhz
atmega88o.upload.protocol=stk500
atmega88o.upload.maximum_size=7680
atmega88o.upload.speed=115200
atmega88o.bootloader.low_fuses=0xff
atmega88o.bootloader.high_fuses=0xdd
atmega88o.bootloader.extended_fuses=0x04
atmega88o.bootloader.path=optiboot
atmega88o.bootloader.file=optiboot_atmega88_16mhz.hex
atmega88o.bootloader.unlock_bits=0x3F
atmega88o.bootloader.lock_bits=0x0F
atmega88o.build.mcu=atmega88
atmega88o.build.f_cpu=16000000L
atmega88o.build.core=arduino:arduino

atmega888o.name=[Optiboot] Arduino NG or older w/ ATmega88 8Mhz
atmega888o.upload.protocol=stk500
atmega888o.upload.maximum_size=7680
atmega888o.upload.speed=115200
atmega888o.bootloader.low_fuses=0xff
atmega888o.bootloader.high_fuses=0xdd
atmega888o.bootloader.extended_fuses=0x04
atmega888o.bootloader.path=optiboot
atmega888o.bootloader.file=optiboot_atmega88_8mhz.hex
atmega888o.bootloader.unlock_bits=0x3F
atmega888o.bootloader.lock_bits=0x0F
atmega888o.build.mcu=atmega88
atmega888o.build.f_cpu=8000000L
atmega888o.build.core=arduino:arduino


Must admit i've not read much about its format and so on. So must likely wrong

Not been all bad mind i've had some success. But once i started thought get it right and completed so don't have to figure out at later date how did this work again :)

Where i'm at now. Well re compile Sparks usb/serial bootloader for at90usb162 which worked. Worked fine with 16mhz88 till i locked myself out fixing make file ...bugger. tried to replace mcu but damage pcb so mad dash to rebuild another.
Got 8mhz88 3v3 but can't upload to it. Has bootloader installed, hit reset led flashes.
16mhz 5v crystal appears to be duff worked up till point avrdude changed fuses to use crystal but couldn't read it after that. So minor fix fingers crossed :)
I'll get ft232 monday so how i fair with that. Thanks again for taking time to put 88 to pcb and sharing your success :)  

So it goes on....

Sadders

Hi

Well i'll have to give up ;( 2 x pcb's and 4 mcu's is my limit. Wanted to use them up but not quite like this..lol

Well i can say Atmega 88 16mhz does work fine. In the zip is very minor change and complied hex.

Thanks, Phil

Go Up