problem in convert 14 bit digital data into 8 bit digital data

Status
Not open for further replies.

abhishekdixit

Full Member level 2
Joined
Dec 30, 2011
Messages
124
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Location
India
Activity points
2,182
hi guys,
i am receiving 14 bit bit digital data, coming through SPI interface, from a IC, now i have to convert it into 8 bit digital format, now i am unable to do it, so if anyone knows, then please help me.

Regards,
Abhishek Dixit
 

You need to specify the bit format i.e. high to low and whether there is bit padding to 16bits with 0's in the high or low end.

Assuming high to low order and no bit padding, you can shift right into an 8 bit register of variable for the low byte.
For the high byte it's the remaining bits, provided 0's were shifted in, or you can mask off the bits with "AND hex 3F".
You could also get the low byte masking with "0F" without shifting if you prefer.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…