Hi Friends...
I am using Analog devices µC ADUC-841 for my application.I am using both adc and dac,and i am displaying the result in serial comm.window,at tat time I need 2 display only 12 bits.But it's displaying 16bits..I am using the printf statement (printf"%02BX %02BX\n",DATAH,DATAL)..Is it a correct way of displaying r anybody tell about this above statement.. Can anybody explain about the printf statement...
With Keil C51, 16 bit values in two consecutive special function registers can be acessed by the sfr16 data type in a single C instruction. The definitions are not included in standard aduc8xx.h-files and have to be added.
Code:
sfr16 ADCDATA_L_H = 0xD9;
12 bit data are extracted by bit mask operations, e. g. (ADCDATA_L_H & 0xfff).