Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

bit shifting with avr-gcc

Status
Not open for further replies.

arnab.bhaumik

Member level 5
Joined
Sep 20, 2006
Messages
81
Helped
6
Reputation
12
Reaction score
3
Trophy points
1,288
Location
Kolkata, India
Activity points
1,835
avr bit shift

hi all,

in a typical application i want to declair an unsigned char and then put a value in it.



say


unsigned char p;

now

p= 0x20;

now i want to bit shift operation on it(may be left or may be right). but with every bit shift operation i want to move the msb to a port pin say pd7,


how come i do that??????



in sdcc with at89c52 what i will do

unsigned char at (0x21) rotor;

bit at(0x21) rotor_msb;

then i will right shift it and access the wanted bit with rotor_msb, but wondering how to do it with atmega8 and avr-gcc.

hope i made my prob clear enaugh............

please reply,

arnab/vu2bpw
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top