- This topic has 3 replies, 3 voices, and was last updated 10 years, 9 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
|
Microcontroller › 8051 › how can shift four 8 bit value to one 32 bit variable
Hi,
Try this,
data = data | a;
data = data << 8;
data = data | b;
data = data << 8;
data = data | c;
data = data << 8;
data = data | d;
hi chandru
problem in ur shifting is ur data is unsigned char , so this is the problem in ur shifting
take a,b,c,d , same type , long int u ill not get problem, other wise make casting and check
hi chandru
unsigned long int data=(unsigned long int )(a<<24)|(unsigned long int )(b<<16)|(unsigned long int )(c<<|(unsigned long int )(d);
try this one it should work !