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

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

Re: [avr-gcc-list] Newbie - should this work?


From: Volkmar Dierkes
Subject: Re: [avr-gcc-list] Newbie - should this work?
Date: Sun, 19 Jan 2003 20:19:58 +0100
User-agent: 40tude_Dialog/2.0.3.1 Hamster/2.0.0.0

Christoph,

On Sun, 19 Jan 2003 18:36:25 +0100, Christoph Plattner wrote:

> In principal, I don't think your code is correct !
>
> All the other answers have not dealt with that, why ???
>
> PORTD and DDRD are defines to registers numbers.
>
> I think you have to use inp() and outp() or do a memory
> access with `* (unsigned char *) <addr> = xxx'
>
>
> example (which works):
>
>      outp(0xff, DDRB);
>      outp(0x00, PORTB);

Since AFAIK 3.2 is the recommend access to I/O ports via direct 
access as Josh has used it. That isn't the problem.

Memory access wouldn't work because they are in the io area, not in 
memory.

Volkmar
avr-gcc-list at http://avr1.org



reply via email to

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