Hi,

You can directly use a port name as a varible.
avr-gcc provides this abstraction.

example:
for reading port A use PORTA

uint8_t x = PORTA;

this will assign the 8 bits os port A into varible x.


Similarly you can write to ports

PORTB = 0xFE;


Regards
Ravi

--- Caloy Diaz <[EMAIL PROTECTED]> wrote:

> Hi, may I ask if any of you know how to read a whole
> port of the Atmel
> microcontroller in Mica 2 with just one instruction?
> All I could read
> now is just one pin at a time, say
> TOSH_READ_INT0_PIN();. I tried
> "messing" with the avrhardware.h and hardware.nido.h
> files, but I get errors and the code doesn't work.
> 
> Other "port-wide" instructions would also help
> greatly (i.e. writing a
> byte to an output port). I can't seem to figure them
> out :)
> 
> Thank you!
> 
> - Caloy
> 
> 
> 
>        
> ---------------------------------
> Looking for a deal? Find great prices on flights and
> hotels with Yahoo! FareChase.>
_______________________________________________
> Tinyos-help mailing list
> [email protected]
>
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



      
____________________________________________________________________________________
Park yourself in front of a world of choices in alternative vehicles. Visit the 
Yahoo! Auto Green Center.
http://autos.yahoo.com/green_center/ 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to