BLIPS

TY stevech for a good looking bootloder.

Im trying to get it working on my mega88p but am having some issues. Ive edited the assembly in the following ways:

.INCLUDE “m88pdef.inc” ;

.equ clock = 8000000 ;

.equ bootldr_baud = 19200 ; //less than 1% error as said by avr calc

and added this block after the mega8 block:

#ifdef M88PDEF_INC ; is within the chosen include file

;==========================================================

;==================== meg88p ==============================

;==========================================================

; UART baud rate setup constant- formula varies by chip type

; where this bootloader code begins, Change if this code outgrows 512 bytes

.equ MYORG = SECONDBOOTSTART ; Use ISP to set fuses for 512 byte boot size (256 words)

.equ UBRRLval = (clock - 8 * bootldr_baud) / (16 * bootldr_baud) ; the 8* part helps rounding

;— device code and signature bytes for a atmega8 with bootloader

.equ DT = 0x77 ; atmega bootloader

; Chip-dependent names for UART registers (See Table, below)

.set BAUDL =UBRR0L ; baud rate low order bits

.set UARTC =UCSR0B ; control

.set USTAT =UCSR0A ; status

.set UDATA =UDR0 ; data I/O register

.set URXC =RXC0 ; rx char complete status bit number (data has arrived)

.set UTXE =UDRE0 ; tx data register is empty

.set UTXC =TXC0 ; tx complete status bit number

; values to use in configuring UART

.set UARTENA =((1<<RXEN0) | (1<<TXEN0)) ; enable tx,rx for uart 0 or 1 (see table)

.MACRO BOOTIDSTRING

.DB “Mega88p”, 0 ; change this 7 char string. bootloader ID string, information-only to PC

.ENDMACRO

.set SPMEN =SELFPRGEN ;SPMEN to SELFPRGEN

.set EEMWE =EEMPE ;EEMWE to EEMPE

.set EEWE =EEPE ;EEWE to EEPE

;=========================================================

#endif

The only thing im not sure about is what DT is.

It assembles to 496 bytes.

My fuses are:

FC DF E2

bootsz= 256 words, boot addy 0xF00

bootrst enabled

internal RC Osc

divide by 8 clock is disabled.

Its just not responding at all. I have tried using Brays terminal like you suggested in a another thread to send esc esc and and s but am getting no response.

I loaded up a little program just to echo USART to check the USART hardware, and it seems to be working fine.

Do you have any ideas of things I could try?

Im using an stk500 is that matters at all.

I appreciate any help and the time you spent working on this already. Thankyou!

Oh i should have said that all ive been trying to do is read the chip ID and am getting a TIMEOUT no response from boot loader error.

Have you asked on the AVRfreaks forum if anyone has a working version of BLIPS for a mega88? I think someone has done it.

A quick read, I note: Internal oscillator. Notorious for baud rate errors versus time and temperature. You probably know that. Can you use a crystal? 19200 is kinda slow.

fuses: I don’t know the hex codes you show from memory. Of course, you’ll need internal osc, bootstrap enable, bootstrap area size of 512 bytes (256 words).

You might want to alter the constant in the AVR side code that controls how long the code loops looking for the PC side BLIPS before jumping off to location 0. Lengthen it. And/or use the blinking LED scheme.

You can also use a dumb terminal program - com port link to AVR (you do know that the RS232 interface is good?) If you hit the ESC key while the AVR side of BLIPS is polling, after a reset, you should see the ID string and so on.

I think i found the user you speak of with a working mega88. I sent him a PM seeing what i can find out.

I also tried using an external clock source but with no luck. Im using LED blinking scheme but the LED isn’t blicking at all. It should blink for the length that BLIPS is polling USART for the ESCs right?

It makes me think its not even being programed to the right space even though all the fuses are correct from what you said.

Im going to dig harder to figure it out.

If you are totally stumped, send me the board and I’ll program it for you.

what ISP are you using? It should have a read-back and verify capability, to confirm the flash is correct.

I’m using an stk500 right now. I’m quite sure the code is being programed exactly as its told to. Everything verifies fine. I think its user error that’s causing it to not work. I’m just out of ideas as to what I’m doing wrong.

I’m going to connect the JTAG MKII tonight and do some dW to see if I can’t make some sense of it.

Thanks for the generous offer though.

When I run the program in debug mode with the ICE MKII I at least see the LED blinking now. I have no idea why it would only work in debug mode but not regularly.

something related to power source or grounding when not using the JTAG? Or the oscillator setup?

I cant make any sense of it. I know the clock is right as I checked it with a scope. I can see it on PB0 when I enable the clock out fuse. All the power checks out fine. I mean at the very least the LED should be blinking if A) the code is on there B) its in the proper place and C) BOOTRST and BOOTSZ settings are correct, which I believe they are.

I wonder if its something funky with the STK500 that i just don’t know about. I checked to make sure it wasn’t holding reset low which its not. Im not sure of anything else that it could be.

it should work with no lock bits enabled right?

Well after flashing the device, it verifies fine, yet when I read it back an open up the hex file its all blank. I wonder what that’s all about.

This looks correct as far as being written to the correct location right?

Boot adress is 0x0F00

:020000020000FC
:101E00008FEF94E08DBF9EBF81E08093C40088E196
:101E10008093C10082E084B985B9772788279FEF36
:101E20007A9551F48A9541F495B99A9529F4EE275B
:101E3000FF27E093C10009940091C00007FFF0CF95
:101E40000091C6000B3161F303C0C4D00B31E9F33C
:101E5000013611F409E5ABC0013439F4BBD0B02F21
:101E6000B9D0A02FAA0FBB1FA1C0023631F409E5DB
:101E7000AAD000E0A8D000E49AC00234A1F40ED0A9
:101E8000063489F4A7D0002EA5D0102EFD0131E034
:101E900037BFE89512962297A9F73AC09BD0D02F6A
:101EA00099D0C02F97C0033619F494D0602F7EC00C
:101EB000033449F48FD0702FFD010B0181E087BFFF
:101EC000E895129673C0073661F4E8DF063449F4EA
:101ED000FD01059178D0059176D02297D1F7DF01E9
:101EE000B4CF053691F4EE27FF27EE0FFF1F13E066
:101EF00017BFE89576D0F795E795E05EFF4F80E055
:101F00009FE0E817F90788F351C00D3631F4FD0161
:101F100015E017BFE89565D049C00035E9F30C34EA
:101F2000D9F3053439F40DE04ED00091C00006FF1E
:101F3000FCCF7DCF003711F403E539C0023539F409
:101F4000FD01859105913FD0DF01082F30C0043499
:101F500029F440D000BD16E02CD028C0043619F476
:101F600011E027D024C0043721F407E72CD0002744
:101F70001EC0043511F42ED019C0033539F4E0EF3A
:101F8000FFE105910023A1F01ED0FBCF063521F41F
:101F900001E319D002E30BC0033731F40FE013D093
:101FA00003E911D00EE103C00FE301C00DE00BD037
:101FB0004CCFA1BDB2BD119611FDFA9A1FBBF99984
:101FC000FECF00B508952090C00025FEFCCF009301
:101FD000C60008950091C00007FFFCCF0091C60025
:101FE000089507B700FDFDCF01E107BFE89508950B
:081FF0004D656761383870008F
:00000001FF

Chupa:
This looks correct as far as being written to the correct location right?

Boot adress is 0x0F00

durned if I know! Compare those bytes to the assembly listing, I guess.

The address would be a word, not byte, address.

Be sure to have boot size set to 256 words and reset-to-boot fuses set.

It was an issue with AVR studio 4.16. ughhhhhhhhhhhhhhhhh.

http://www.avrfreaks.net/index.php?name … 715#607715

Thankyou for the help though.

Colbenaa:
I cant make any sense of it. I know the clock is right as I checked it with a scope. I can see it on PB0 when I enable the clock out fuse. All the power checks out fine. I mean at the very least the LED should be blinking if A) the code is on there B) its in the proper place and C) BOOTRST and BOOTSZ settings are correct, which I believe they are.

boot fuse settings for a 256 WORD boot area size? 512 bytes? Matches ORG address in assembly listing?

(beware confusion in assembly code/listing on word address versus byte address)