Hi, Using CW 8.3 for DSC, I generated a project using Processor Expert Stationery.
I then added the DAC, with the default, for PE, settings.
Here is both the C code and its assembly equivalent generated to initialize the DAC for the 8037 device:
setReg16(DAC0_CTRL, 0x01U);
P:00000105: E418F1C00000 move.l #0xf1c0,R0
P:00000108: 86400001 move.w #1,X:(R0)
/* DAC0_DATA: DATA=0 */
setReg16(DAC0_DATA, 0x00U);
P:0000010A: E418F1C10000 move.l #0xf1c1,R0
P:0000010D: 86400000 move.w #0,X:(R0)
/* DAC0_MAXVAL: MAXVAL=0 */
setReg16(DAC0_MAXVAL, 0x00U);
P:0000010F: E418F1C40000 move.l #0xf1c4,R0
P:00000112: 86400000 move.w #0,X:(R0)
/* DAC0_MINVAL: MINVAL=0 */
setReg16(DAC0_MINVAL, 0x00U);
P:00000114: E418F1C30000 move.l #0xf1c3,R0
P:00000117: 86400000 move.w #0,X:(R0)
/* DAC0_STEP: STEP=0 */
setReg16(DAC0_STEP, 0x00U);
P:00000119: E418F1C20000 move.l #0xf1c2,R0
P:0000011C: 86400000 move.w #0,X:(R0)
/* DAC0_CTRL: PDN=0 */
clrReg16Bits(DAC0_CTRL, 0x01U);
P:0000011E: E418F1C00000 move.l #0xf1c0,R0
P:00000121: 80400001 bfclr #1,X:(R0)