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!