---------------------------------------------------------------------- Patch name: patch.for-8535 Author: Bryce Denney Date: Sun Mar 3 21:13:45 EST 2002 Detailed description: The avr910.asm code does NOT work out of the box very many parts. It was written for the 1200 but with minimal changes it can work anywhere. With this patch, the code works on an 8535. The most critical change is that you must initialize the stack pointer. Also, change the include file to target whatever chip you want to use. And for chips that have a hardware UART, the TXC and RXC symbols are already defined in the include file so you need to comment out those definitions to avoid errors. That's it! I strongly suggest that the app note be updated to at least mention the initialization of the stack pointer for non-1200 parts. Commented-out stack init code would be a very easy solution. This would have saved me a couple of hours of debugging. Patch was created with: diff -u Instructions: Go to whatever directory avr910.asm is in. Type "patch < THIS_PATCH_FILE". ---------------------------------------------------------------------- Index: avr910.asm =================================================================== RCS file: /usr/src/CVSROOT/designs/avr910/avr910.asm,v retrieving revision 1.2 diff -u -b -r1.2 avr910.asm --- avr910.asm 2002/01/16 22:30:56 1.2 +++ avr910.asm 2002/03/02 07:48:00 @@ -3,7 +3,7 @@ ;* Title : AVR ISP (Auto adr inc, 19200bps) ;* Version : 2.3 ;* Last updated : 13 mar 2000 (arodland) -;* Target : AT90S1200 +;* Target : AT90S8535 ;* File : avr910.asm ;* Author(s) : Ole Saether, Terje Frostad, ;* Ingar Fredriksen, Morten W. Lund @@ -188,7 +188,7 @@ ;**** includes **** -.include "1200def.inc" +.include "8535def.inc" ;*************************************************************************** ;* @@ -304,8 +304,9 @@ ;**** Bit positions in UART Status Register **** -.equ TXC = 0 ; Transmit -.equ RXC = 1 ; Receive +;**** on 8535, TXC/RXC already defined +;.equ TXC = 0 ; Transmit +;.equ RXC = 1 ; Receive ;***************************** ;* Global Register Variables * @@ -610,6 +611,12 @@ ;*************************************************************************** RESET: + ;; init stack (required on all but 1200) + ldi temp1, high(RAMEND) + out SPH, temp1 + ldi temp1, low(RAMEND) + out SPL, temp1 + clr temp1 out GIMSK,temp1 ; disable external interrupt ser temp1 ; Initialize