---------------------------------------------------------------------- Patch name: patch.for-2313 Author: Bryce Denney Date: Thu Jun 13 18:45:04 EDT 2002 Detailed description: This is based on patch.for-8535, which I wrote back in March 2002. 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 a 2313. 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. 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/06/12 14:22:14 @@ -3,7 +3,7 @@ ;* Title : AVR ISP (Auto adr inc, 19200bps) ;* Version : 2.3 ;* Last updated : 13 mar 2000 (arodland) -;* Target : AT90S1200 +;* Target : AT90S2313 ;* File : avr910.asm ;* Author(s) : Ole Saether, Terje Frostad, ;* Ingar Fredriksen, Morten W. Lund @@ -188,7 +188,7 @@ ;**** includes **** -.include "1200def.inc" +.include "2313def.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,10 @@ ;*************************************************************************** RESET: + ;; init stack (required on all but 1200) + ldi temp1, low(RAMEND) + out SPL, temp1 + clr temp1 out GIMSK,temp1 ; disable external interrupt ser temp1 ; Initialize