You are here: Register Set > DAC Channel-B (Offset=6)
STX104 Reference Manual
ContentsIndexHome
Example

Examples of how to write to the DAC output register in 16-bit DAC mode. 

 

8-Bit Writes in C/C++:

unsigned int dac_value; 

... 

outp( base_address+6, dac_value & 0xFF ); 

outp( base_address+7, dac_value >> 8 ); 

... 

 

or 

 

union { unsigned int word; unsigned char byte[2]; } dac_value; 

... 

outp( base_address+6, dac_value.byte[0] ); 

outp( base_address+7, dac_value.byte[1] ); 

... 

 

 

16-Bit Write in C/C++:

unsigned int dac_value; 

... 

outpw( base_address+6, dac_value ); 

...

Copyright © 1997-2008 by Apex Embedded Systems. All rights reserved. Updated on Wednesday, April 02, 2008.