You are on page 1of 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