0% found this document useful (0 votes)
70 views2 pages

Sample Code AWG

The document describes code for loading startup patterns onto an APU12 device and measuring voltage levels during startup. It selects the appropriate startup pattern based on the startup voltage level, runs a startup sequencer, reads ADC measurements of the voltage pin during startup, analyzes the readings to find the peak voltage value, and stores the results in an array.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views2 pages

Sample Code AWG

The document describes code for loading startup patterns onto an APU12 device and measuring voltage levels during startup. It selects the appropriate startup pattern based on the startup voltage level, runs a startup sequencer, reads ADC measurements of the voltage pin during startup, analyzes the readings to find the peak voltage value, and stores the results in an array.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

apu12awgloader( VDD, "VddStartup3p3", APU12_FV, APU12_10V, APU12_200MA,

VddStartup3p3_Data, (sizeof(VddStartup3p3_Data)/sizeof(double)),
&VddStartup3p3_Regions );
//pattern to run
apu12awgloader( VDD, "VddStartup2p5", APU12_FV, APU12_10V, APU12_200MA,
VddStartup2p5_Data, (sizeof(VddStartup2p5_Data)/sizeof(double)),
&VddStartup2p5_Regions );
apu12awgloader( PROG_A, "VddStartup3p3", APU12_FV, APU12_10V, APU12_10MA,
OEStartup3p3_Data, (sizeof(OEStartup3p3_Data)/sizeof(double)),
&OEStartup3p3_Regions );
apu12awgloader( PROG_A, "VddStartup2p5", APU12_FV, APU12_10V, APU12_10MA,
OEStartup2p5_Data, (sizeof(OEStartup2p5_Data)/sizeof(double)),
&OEStartup2p5_Regions );
mcusequence(MCU_CH1, "StartupSequencer", "CLEAR, 4000 on", 0); // used for
startup
char StartupAWG[100];
if (startup_vdd > 3.27)
sprintf(StartupAWG, "VddStartup3p3");//3.3
else if (startup_vdd >= 2.973)
sprintf(StartupAWG, "VddStartup3p0");//3.0
else if (startup_vdd >= 2.969)
sprintf(StartupAWG, "VddStartup3p3_Min");//2.97
else if (startup_vdd >= 2.799)
sprintf(StartupAWG, "VddStartup2p8");//2.8
else if (startup_vdd >= 2.699)
sprintf(StartupAWG, "VddStartup3p0_Min");//2.7
else if (startup_vdd >= 2.51)
sprintf(StartupAWG, "VddStartup2p8_Min");//2.52
else if (startup_vdd >= 2.249)
sprintf(StartupAWG, "VddStartup2p5");//2.5
else if (startup_vdd > 2.2)
sprintf(StartupAWG, "VddStartup2p5_Min");//2.25
else
sprintf(StartupAWG, "VddStartup3p3_Min");
//choose the right pattern to run
int samples = 4000;
//sample to collect
int StartPosition = 0;
RESULTS_STR Vdd_Startup[NUM_SITES *4]; // max of 4 measurements per
site //array to store the result
int sample_rate = 10; //time for each sample collected
double startuptime[NUM_SITES];
mcuconnect(MCU_CH1, "Group%d,Group%d", VDD, PROG_A); //connect resource to
mcu
mcumode(MCU_CH1, MCU_CLK, 300, MCU_CLKA, MCU_TRIGNORMAL, 0.0); //set the
clock for mcu
apu12set(VDD, APU12_FVAWG, 0.0, APU12_10V, APU12_200MA, APU12_PIN_TO_VI);
//initialize
apu12set(PROG_A, APU12_FVAWG, 0.0, APU12_10V, APU12_10MA,
APU12_PIN_TO_VI); //initialize
if (FeaturePin_Int == 2)
{
apu12awgselect(PROG_A, StartupAWG); //choose the pattern to run
}
apu12awgselect(VDD, StartupAWG); //choose the pattern to run
apu12adcmode(VDD, APU12_MI_1X, 1); //ADC to measure the pin change
during mcu run
lwait(1000);
StartPosition = StartPosition + 50; //start point to search
mcurun("StartupSequencer", MCU_NODIGITAL, 1);//run the sequence
blockread(VDD, -1); //read the result output
namearray("vdd_stup_awg", NAMEARRAY_APU12ADC, VDD, 1); //store the result on
array
peak("vdd_stup_awg", StartPosition, samples, PEAK_HI); //check for the peak
from start position
groupgetresults(Vdd_Startup, NUM_SITES); //store the result on array
Fill_Datalog_Array();
FOR_EACH_SITE(site, NUM_SITES)
{
Fill_Datalog_Array_Results[site].value = Vdd_Startup[site].value;
}

You might also like