Yahoo Groups archive

AVR-Chat

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

Message

RE: [AVR-Chat] Programming a Butterfly (ATMega169)

2006-03-09 by Chuck Hackett

As follow-up to my first message in this thread:

I verified that I can reload the original Butterfly program (hex file from
Atmel's site) and it still works fine - nice to have a "known good" point to
start from and return to :-)

I then cleared (unprogrammed) the BOOTRST fuse and my WinAVR version of the demo
program can now be programmed by AVRStudio via the JTAG without errors.

It now starts normally (as shown by the debugger) but does not function
correctly yet.  I'm sure that it has something to do with my translation from
CodeVision to WinAVR.

One thing I've discovered that is different from my debugging days on mainframes
and minis is that it's difficult to 'step' through code (w/AVRStudio) because of
the frequency of interrupts (LCD scan completion in my case).  I'm thinking
that, rather than use the debugger "step" function, the best approach would be
to manually advance a breakpoint as I go (aside: I would have thought that
"step" would have been doing this internally).

I also discovered that, when I tried to compile the demo with optimization = 0
(to make debugging easier), the code was too big (122% full) for the available
program memory so I compiled it with opt=s (85% full).  I may go back and try
some other optimization levels to strike a compromise.

Am I going about this (debugging, opt, etc.) correctly or are there other
techniques I should employ?

Cheers,

Chuck Hackett
"Good judgment comes from experience, experience comes from bad judgment"
7.5" gauge Union Pacific Northern (4-8-4) 844
http://www.whitetrout.net/Chuck

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.