AN123 Silicon_Laboratories, AN123 Datasheet - Page 13

no-image

AN123

Manufacturer Part Number
AN123
Description
Using THE DAC AS A Function Generator
Manufacturer
Silicon_Laboratories
Datasheet
//-----------------------------------------------------------------------------
// Off
//-----------------------------------------------------------------------------
//
// Sets output to zero volts DC.
//
void Off (void)
{
}
//-----------------------------------------------------------------------------
// Help
//-----------------------------------------------------------------------------
//
// Prints the command list.
//
void Help (void)
{
}
//-----------------------------------------------------------------------------
// Error
//-----------------------------------------------------------------------------
//
//
//
void Error(void)
{
}
//*****************************************************************************
// Interrupt Handlers
//*****************************************************************************
//-----------------------------------------------------------------------------
// Timer4_ISR -- Wave Generator
//-----------------------------------------------------------------------------
//
// This ISR is called on Timer4 overflows.
// and is used to schedule the DAC output sample rate in this example.
// Note that the value that is written to DAC1 during this ISR call is
// actually transferred to DAC1 at the next Timer4 overflow.
//
void Timer4_ISR (void) interrupt 16 using 3
{
printf (“\n\n*** OUTPUT OFF”,string1);
output_waveform = OFF;
Print_Command_List();
Print_Command_List();
printf (“
static unsigned phase_acc = 0;
int temp1;
Indicates that an invalid command was entered at the command prompt.
***INVALID INPUT = %s\n”, input_str);
// holds phase accumulator
// the temporary value that passes
// through 3 stages before being written
// to DAC1
Rev. 1.1
Timer4 is set to auto-reload mode
AN123
13

Related parts for AN123