From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fcd0ac136c3a2795 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!m1g2000yqo.googlegroups.com!not-for-mail From: "b.robinson.jp@gmail.com" Newsgroups: comp.lang.ada Subject: Re: USB Boarduino on AVR-Ada Tutorial Date: Wed, 1 Sep 2010 20:39:59 -0700 (PDT) Organization: http://groups.google.com Message-ID: <3be87447-5b06-4fcc-a0ed-7037659b81a5@m1g2000yqo.googlegroups.com> References: <4d1d662b-f476-41e4-938c-0564ad90d74e@d17g2000yqb.googlegroups.com> <8bfbd728-638e-4d27-b52e-0107c6b2847d@i31g2000yqm.googlegroups.com> <1db702dd-3289-4e76-98fe-08ab4bae38e1@v8g2000yqe.googlegroups.com> NNTP-Posting-Host: 98.124.107.116 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1283398799 31236 127.0.0.1 (2 Sep 2010 03:39:59 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 2 Sep 2010 03:39:59 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m1g2000yqo.googlegroups.com; posting-host=98.124.107.116; posting-account=ebuo9QkAAAA0kzM9P_xqJLx9heyefZNO User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8,gzip(gfe) Xref: g2news1.google.com comp.lang.ada:13904 Date: 2010-09-01T20:39:59-07:00 List-Id: Thanks for the suggestion. I do have the right chip number (I verified it on the surface of the IC too), and I do have the right IO port and pin number (verified with the C program). The C version compiles and runs as expected, so I think I'm going to have to study the bootstrapping process and get my hands wet. On Aug 27, 8:51=A0am, Warren wrote: > b.robinson...@gmail.com expounded in news:1db702dd-3289-4e76-98fe- > 08ab4bae3...@v8g2000yqe.googlegroups.com: > > >>.. I was able to > > compile the project and generate my binary. =A0The LED stays lit and > > does not flash, but at least I have something to work on now. :) > > Check that you have exactly the right part specified for > compiling the unit. What happens is that the object code > may be compatible, but the configured SRAM size is not. This > is critical in the main program, where it initializes the > stack pointer (SP) at startup. > > I ran into this when building for atmega328, which supports > a 2K SRAM. I was using an atmega168 with a 1K SRAM instead, > but is otherwise completely compatible with the 328. =A0 > > So everything would work until you _called_ something. The > called routine might work (if it needed no local vars or kept > them in registers). But when it would try to return to the > calling program, it would go west. Building for the 328 > sets the SP 1K higher than the 168 address wise, where > there is no SRAM. So a return would go to address 16#FFFF#, > since FF is what "no memory" returns. > > Compiling _libraries_ for a bigger part is ok, since it > doesn't have to initialize the SP. =A0But the main program > has to be "right on" in this respect. > > In your case, I suspect that the delay routine is not > returning properly. This strongly hints at the stack > size problem. So check that MCU=3D parameter (I had to > get a magnifying glass out to read my chip). > > Warren