AN123 Silicon_Laboratories, AN123 Datasheet - Page 10

no-image

AN123

Manufacturer Part Number
AN123
Description
Using THE DAC AS A Function Generator
Manufacturer
Silicon_Laboratories
Datasheet
AN123
} // end main
//-----------------------------------------------------------------------------
// Init Routines
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// SYSCLK_Init
//-----------------------------------------------------------------------------
//
// This routine initializes the system clock to use a 22.1184MHz crystal
// as its clock source.
//
void SYSCLK_Init (void)
{
}
//-----------------------------------------------------------------------------
// PORT_Init
//-----------------------------------------------------------------------------
//
// Configure the Crossbar and GPIO ports
10
} // end while(1)
int i;
OSCXCN = 0x67;
for (i=0; i < 256; i++) ;
while (!(OSCXCN & 0x80)) ;
OSCICN = 0x88;
}// end for
// call the associated function
f = (void *) function_table[i].function_ptr;
f();
EA = 1;
} // end if
printf(“\nFREQUENCY: %ld Hz”, frequency);
printf(“\nAMPLITUDE: %d %% of VREF/2”, printed_amplitude);
EA = 0;
// set the frequency
phase_add = frequency * PHASE_PRECISION / SAMPLE_RATE_DAC;
break;
// delay counter
// start external oscillator with
// 22.1184MHz crystal
// Wait for osc. to start up
// Wait for crystal osc. to settle
// select external oscillator as SYSCLK
// source and enable missing clock
// detector
Rev. 1.1
// Disable Interrupts to avoid
// contention between the ISR
// and the following code.
// re-enable interrupts

Related parts for AN123