Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Frustration abounds..

2007-07-18 by Dave Hylands

Hi Dave,

> Loaded into a chip, the app gives me wierd problems that shift as I
> include and remove debugging code, as if there was a flag or stack
> problem, but myself, and another experienced SW guy have been over it
> and we didn't catch anything significant.

This is typically symptomatic of using uninitialized variables (in C -
in assembler it would correspond to uninitialized registers).

There's also the whole byte/word difference problem . (i.e. you're not
trying to erase the area that the bootloader is in when you really
think you're only around the 64k mark).

XModem would be sending bytes, but you're going to be programming words.

> I'm sending messages on the second serial port to debug, and I am
> using/preserving ELPM during those routines.  Stack pointer IS
> initted, and I'm only using ram up to $0185, with SP at $10FF
>
> 00ff80 9350 0102        sts                     XmodemBlk,Expseq
>        ;
> 00ff82 ef0f             ldi                     TEMP,$FF
>                ;
> 00ff83 1b05             sub                     TEMP,Expseq
>                ;
> 00ff84 9300 0103        sts                     XmodemBlk+1,TEMP
>        ;
> ;Above here, I'm faking in a 'received packet' so I can sim through
> ;verification and programming into the program memory.
>
> 00ff86 dedb             rcall           Get_Packet_Verify       ;
> 00ff87 9508             ret <--- Here's where it says there's an
> $FFFF opcode..
>
> SP at this moment is $10FD, and will be $10FF if this return would
> actually return...  In sim, the execution drops into some send
> message from rom routines and this behaviour is very very similar to
> what's happening in the real chip.
>
>
>
>
>
>
> Yahoo! Groups Links
>
>
>
>


-- 
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.