// filename DACtest.C // test of DAC8043 interface // Last modified 4/10/02 by Jonathan W. Valvano // Copyright 2002 by Jonathan W. Valvano, valvano@uts.cc.utexas.edu // You may use, edit, run or distribute this file // as long as the above copyright notice remains #include "HC12.h" #include "DAC8043.H" void main(void){ unsigned short n; COPCTL = 0x00; // disable COP TSCR = 0x80; // TEN(enable) DDRT |= 0x40; // debugging output DAC8043_Init(); n = 0; while(1){ PORTT ^= 0x40; // toggle LED while(n<4096){ DAC8043_Out(n); n = n+1; } while(n>0){ n = n-1; DAC8043_Out(n); } } } #include "DAC8043.C" extern void _start(); #pragma abs_address:0xfffe void (*reset_vector[])() = { _start }; #pragma end_abs_address