Ok so im trying to compile this bootloader on my mega164P and the documentation is kinda lacking on how to add your chip properly.
I edited these things in the .asm
.INCLUDE "m164Pdef.inc" .equ clock = 8000000 .equ bootldr_baud = 19200 #ifdef _M164PDEF_INC_ ;--- device code and signature bytes .equ DT = 0x09 ; atmega bootloader ; values to use in configuring UART .set BAUDL =UBRR0L .set UARTC =UCSR0B .set USTAT =UCSR0A .set UDATA =UDR0 .set URXC =RXC0 .set UTXE =UDRE0 .set UTXC =TXC0 .set UARTENA =((1<<RXEN0) | (1<<TXEN0)) .MACRO BOOTIDSTRING .DB "Mega164", 0 .ENDMACRO ; .set SPMEN = SELFPRGEN .set EEMWE = EEMPE .set EEWE = EEPE #endif
Now the top three are easy. Got the 19200baud from a chart 0.2% error rate. I dont know what to put in as the device string as the datasheet is for the mega644 and out of the 3 bytes im assuming its the right hand one I wanted.
I get these compile time errors:
-I commented out SPMEN as it said "Invalid redefinition of 'SPMEN'"
-elpm R16, Z+ Unsuported instruction on atmega164P
-End of .cseg at 0x400a is beond end of memory 0x3fff
I have never used a bootloader before and I do not understand asm without a headache so im unsure what to do here.