AW: [En-Nut-Discussion] Just a minor patch...

Radek Podgorny radek at podgorny.cz
Tue Sep 21 18:20:13 CEST 2004


Harald,

the tools I use come AFAIK from the CD I got with Ethernut 1.3 box I bought 
some time ago. The bad thing is that I can't check now because the CD is 
lost. Stupid me. Anyway, my OS is linux. Versions follow:

avr-binutils-1.12.90.20020708
avr-gcc-3.2.0.0-20020708
avr-gcc-c++-3.2.0.0.20020708
avr-libc-20021118cvs

I found the defines you were talking about but the TCCR0 ones were like CS10, 
CS11, etc. which looks strange. I'm downloading the latest tools right now to 
check it out...

...after a while...

...so, my new tools:
avr-binutils-2.14
avr-gcc-3.3
avr-libc-1.0.2

The iom1028.h file seems to be fixed now (just like yours)...

I'm sorry for wasting your time. My fault. I should have stayed up-to-date 
with the latest avr-libc...

Sincerely
Radek Podgorny



> Radek,
>
> from C:\icc\include\iom128.h
>
> /* TCCR0 Timer/Counter 0 Control Register */
> #define FOC0    7
> #define WGM00   6
> #define COM01   5
> #define COM00   4
> #define WGM01   3
> #define    CS02         2
> #define    CS01         1
> #define    CS00         0
>
> For example CS2 is not available with ICCAVR.
>
>  From avr-libc, iom128.h
>
> /* Timer/Counter Control Register (generic) */
> #define    FOC          7
> #define    WGM0         6
> #define    COM1         5
> #define    COM0         4
> #define    WGM1         3
> #define    CS2          2
> #define    CS1          1
> #define    CS0          0
>
> /* Timer/Counter 0 Control Register - TCCR0 */
> #define    FOC0         7
> #define    WGM00        6
> #define    COM01        5
> #define    COM00        4
> #define    WGM01        3
> #define    CS02         2
> #define    CS01         1
> #define    CS00         0
>
> Both are available here. Which compiler, library and PC-OS
> are you using?
>
> Harald
>
> At 16:13 21.09.2004 +0200, you wrote:
> >Hi,
> >
> >it's the line just after the #ifdef. Somehow, it doesn't compile when we
> > use the two-digit notation:
> >
> >bad: outp(BV(CS00) | BV(CS02) | BV(WGM01), TCCR0);
> >good: outp(BV(CS0) | BV(CS2) | BV(WGM1), TCCR0);
> >
> >I have practicaly no experience with avr and related stuff, this is just
> > what i found by experimenting...
> >
> >Radek Podgorny
> >
> > > Radek,
> > >
> > > your patch was
> > >
> > > --- timer.c.orig        2004-03-05 21:38:41.000000000 +0100
> > > +++ timer.c     2004-08-04 15:32:42.000000000 +0200
> > > @@ -634,7 +634,7 @@
> > >        *   register, so we'll get a compare match interrupt every
> > > millisecond. */
> > >   #ifdef __AVR_ATmega128__
> > > -    outp(BV(CS00) | BV(CS20) | BV(WGM01), TCCR0);
> > > +    outp(BV(CS0) | BV(CS2) | BV(WGM1), TCCR0);
> > >   #else
> > >       outp(BV(CS00) | BV(CS02) | BV(CTC0), TCCR0);
> > >   #endif
> > >
> > > os/arch/avr_timer.c in HEAD (and 3.9.1) is
> > >
> > > #ifdef __AVR_ATmega128__
> > >      outp(BV(CS00) | BV(CS02) | BV(WGM01), TCCR0);
> > > #else
> > >      outp(BV(CS00) | BV(CS02) | BV(CTC0), TCCR0);
> > > #endif
> > >
> > > Where is the difference between your patch and the current
> > > release?
> > >
> > > Harald
> > >
> > > _______________________________________________
> > > En-Nut-Discussion mailing list
> > > En-Nut-Discussion at egnite.de
> > > http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
> >
> >--
> >GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x98E56D84
> >_______________________________________________
> >En-Nut-Discussion mailing list
> >En-Nut-Discussion at egnite.de
> >http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion

-- 
GnuPG key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x98E56D84
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20040921/beb336c6/attachment-0001.pgp>


More information about the En-Nut-Discussion mailing list