avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] GCC Functions


From: Valéry Florimond
Subject: Re: [avr-gcc-list] GCC Functions
Date: Wed, 28 Nov 2001 15:32:56 -0500

Hi,

I never met your issue and don't use your micro but to set register
dynamically, I use
"__mmio" instead of "outp"

Replace in your code:
    outp(ledlight, PORTB);

with:
    __mmio(PORTB) = ledlight;

I don't know if it will fix your problem, just an idea.

Valery.



----- Original Message -----
From: "Patrick Lanphier" <address@hidden>
To: "Joerg Wunsch" <address@hidden>
Cc: <address@hidden>
Sent: Wednesday, November 28, 2001 9:56 AM
Subject: Re: [avr-gcc-list] GCC Functions


> Well the lights do not turn on when using the function when they do with
> the simple assignment statement.  As you can see this is a very simple
> test.  I could put more in the function, however, I would then have to
> implement this in the main also.  I was attempting find the problem with
> the simplest possible test.
>
> Patrick Lanphier
> The Artemis Group
> http://www.artemisgroup.com
> phone: 814-235-0444
>   fax: 800-582-9710
>
> On Wed, 28 Nov 2001, Joerg Wunsch wrote:
>
> > Patrick Lanphier <address@hidden> wrote:
> >
> > > Thanks everyone for the help but things are still not working.  It
> > > has to do with the function or the global variable.  If you toggle
> > > between the lines you will see this.
> >
> > What will we see?  Can you elaborate more?
> >
> > Generating assembler code shows that both statements create
> > identical lines of the form:
> >
> >         sts ledlight,__zero_reg__
> >
> > Unless you tell us a bit more, there's probably not much help.  Your
> > code /is/ correct (assuming your LEDs are connected between port B and
> > Vcc).
> >
> > Also, why don't you try one of my suggestions about implementing a
> > somewhat more sophisticated logic inside led1() (like counting the
> > variable ledlight up)?  This would allow you a few more hardware
> > tests, like connecting an oscilloscope to the various output lines of
> > port B.  This will help you find out whether the output lines are
> > actually toggling at some frequency, are "floating", or maybe just one
> > of the output drivers has been damaged by your experiments.
> >
> >
>
>
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]