Stanley Products brings you high quality spare parts, made in the same factories their intended machines are manufactured in. With an enormous range of spare parts at affordable prices, Stanley Products can help you when you need it. If you haven’t found the part you’re looking for here, chances are we have it in our warehouse! Simply call us on AU: 1300 660 457 or NZ: 0800 474 876 or email us at [email protected] to speak with our dedicated Spare Parts team.

Stanley backpack sprayer partsdiagram

void multiply_matrix_vector(double matrix[2][2], double vector[2], double result[2]) { result[0] = matrix[0][0] * vector[0] + matrix[0][1] * vector[1]; result[1] = matrix[1][0] * vector[0] + matrix[1][1] * vector[1]; } void transpose_multiply(double transposed[2], double P[2][2], double Bd[2], double *scalar_result) { double temp[2]; temp[0] = transposed[0] * P[0][0] + transposed[1] * P[1][0]; temp[1] = transposed[0] * P[0][1] + transposed[1] * P[1][1]; *scalar_result = temp[0] * Bd[0] + temp[1] * Bd[1]; } // // Included Files // #include "driverlib.h" #include "device.h" // // Defines // #define EX_ADC_RESOLUTION 12 // // Globals // uint16_t adcAResult; uint16_t adcBResult; // // Function Prototypes // void initADCA0(void); void initADCSOCA0(void); uint16_t voltA; // // Main // void main(void) { // // Initialize device clock and peripherals // Device_init(); // // Disable pin locks and enable internal pullups. // Device_initGPIO(); // // Initialize PIE and clear PIE registers. Disables CPU interrupts. // Interrupt_initModule(); // // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // Interrupt_initVectorTable(); // // Set up ADCs, initializing the SOCs to be triggered by software // initADCA0(); initADCSOCA0(); initADCB1(); initADCSOCB1(); // // Enable Global Interrupt (INTM) and realtime interrupt (DBGM) // EINT; ERTM; double P[2][2] = {{1.3344, 4.3140}, {4.3140, 34.3636}}; // Fixed double Ad[2][2] = {{0.9993, -0.0146}, {0.0995, 0.9893}}; // Fixed double Bd[2] = {0.7057, 0.0352}; // Fixed double x_ref[2] = {2, 5}; // Fixed double x_0[2] = {0.55, 5}; // Input double d_0 = 0.2; // Input double R = 1.0; // Fixed double Ad_x0[2]; double Bd_d0[2]; double diff[2]; double scalar_result; double gradient; double volt_current; // // Loop indefinitely // while(1) { ADC_enableInterrupt(ADCA_BASE, ADC_INT_NUMBER1); ADC_enableInterrupt(ADCB_BASE, ADC_INT_NUMBER2); // // Convert, wait for completion, and store results // ADC_forceSOC(ADCA_BASE, ADC_SOC_NUMBER0); // // Wait for ADCA to complete, then acknowledge flag // while(ADC_getInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1) == false) { } ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1); // Store results // voltage = (adcAResult0/4095)*3 adcAResult = ADC_readResult(ADCARESULT_BASE, ADC_SOC_NUMBER0); x_0[1] = ((double) adcAResult / 4095.0) * 3.0; // Voltage of buck converter output ADC_forceSOC(ADCB_BASE, ADC_SOC_NUMBER1); // Wait for ADCA to complete, then acknowledge flag while(ADC_getInterruptStatus(ADCB_BASE, ADC_INT_NUMBER2) == false) { } ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER2); // Store results // voltage = (adcBResult0/4095)*3 adcBResult = ADC_readResult(ADCBRESULT_BASE, ADC_SOC_NUMBER1); volt_current = ((double) adcBResult / 4095) * 3.0; // Voltage for inductor current output x_0[0] = volt_current/1; // place holder resistance value of 1. Convert from voltage across resistance to current // Step 1: Ad * x0 multiply_matrix_vector(Ad, x_0, Ad_x0); // Step 2: Bd * d0 Bd_d0[0] = Bd[0] * d_0, Bd_d0[1] = Bd[1] * d_0; // Step 3: x_ref - (Ad * x0 + Bd * d0) diff[0] = x_ref[0] - Ad_x0[0] - Bd_d0[0], diff[1] = x_ref[1] - Ad_x0[1] - Bd_d0[1]; // Step 4: Transpose diff and calculate scalar transpose_multiply(diff, P, Bd, &scalar_result); // Final result: 2 * R * d0 - 2 * scalar_result gradient = 2 * R * d_0 - 2 * scalar_result; // // Software breakpoint. At this point, conversion results are stored in // adcAResult0, adcAResult1, adcDResult0, and adcDResult1. // ESTOP0 // } } // // Function to configure and power up ADCs A and C. // void initADCA0(void) { // Set ADCDLK divider to /4 ADC_setPrescaler(ADCA_BASE, ADC_CLK_DIV_4_0); // Set ADC Resolution to 12 bits, (10.5 ADCCLK cycles to convert) (~50 ns conversion time) // 16 bit resolution requires 29.5 ADCCLK cycles to convert // ADC_MODE_SINGLE_ENDED is sample through pin ADCINx and referenced to VREFLO (VREFLO should be ground) ADC_setMode(ADCA_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); // Set end of conversion pulse positions to late (can ignore) ADC_setInterruptPulseMode(ADCA_BASE, ADC_PULSE_END_OF_CONV); // Power up the ADCA (need at least a 500 us delay) ADC_enableConverter(ADCA_BASE); // 1 ms delay DEVICE_DELAY_US(1000); } // // Function to configure SOCs 0 and 1 of ADCs A and C. // void initADCSOCA0(void) { // // Configure SOCs of ADCA // - SOC0 will convert pin A0. // - SOC1 will convert pin A1. // - Both will be triggered by software only. // - For 12-bit resolution, a sampling window of 15 (75 ns at a 200MHz // SYSCLK rate) will be used. For 16-bit resolution, a sampling window // of 64 (320 ns at a 200MHz SYSCLK rate) will be used. // - NOTE: A longer sampling window will be required if the ADC driving // source is less than ideal (an ideal source would be a high bandwidth // op-amp with a small series resistance). See TI application report // SPRACT6 for guidance on ADC driver design. // // Trigger with software only, (ADC interrupt) // Setting up multiple SOCs, means you can set up multiple sequences of conversion // (SOC on pin A0, that is J3 - 10) ADC_setupSOC(ADCA_BASE, ADC_SOC_NUMBER0, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN0, 64); // // Set SOC0 to set the interrupt 1 flag. Enable the interrupt and make // sure its flag is cleared. // ADC_setInterruptSource(ADCA_BASE, ADC_INT_NUMBER1, ADC_SOC_NUMBER0); ADC_enableInterrupt(ADCA_BASE, ADC_INT_NUMBER1); ADC_clearInterruptStatus(ADCA_BASE, ADC_INT_NUMBER1); //ADC_enableContinuousMode(ADCA_BASE, ADC_INT_NUMBER1); ADC_setInterruptSOCTrigger(ADCA_BASE, ADC_SOC_NUMBER0, ADC_INT_SOC_TRIGGER_ADCINT1); ADC_disableInterrupt(ADCA_BASE, ADC_INT_NUMBER1); } // Functions for ADCB void initADCB1(void) { // Set ADCDLK divider to /4 ADC_setPrescaler(ADCB_BASE, ADC_CLK_DIV_4_0); // Set ADC Resolution to 12 bits, (10.5 ADCCLK cycles to convert) (~50 ns conversion time) // 16 bit resolution requires 29.5 ADCCLK cycles to convert // ADC_MODE_SINGLE_ENDED is sample through pin ADCINx and referenced to VREFLO (VREFLO should be ground) // Need 16 bit for differential mode ADC_setMode(ADCB_BASE, ADC_RESOLUTION_12BIT, ADC_MODE_SINGLE_ENDED); // Set end of conversion pulse positions to late (can ignore) ADC_setInterruptPulseMode(ADCB_BASE, ADC_PULSE_END_OF_CONV); // Power up the ADCA (need at least a 500 us delay) ADC_enableConverter(ADCB_BASE); // 1 ms delay DEVICE_DELAY_US(1000); } // Function to configure SOC 0 of ADCB void initADCSOCB1(void) { // This should actually be configured for an ampmeter setup. This means we will need // a differential ADC configuration (see page 1560 of technical reference manual and page 107 of data sheet for details) // Trigger with software only, (ADC interrupt) // Setting up multiple SOCs, means you can set up multiple sequences of conversion // (SOC on pin , that is J3 - 3 for 14 and J7 - 3 for 15) ADC_setupSOC(ADCB_BASE, ADC_SOC_NUMBER1, ADC_TRIGGER_SW_ONLY, ADC_CH_ADCIN15, 64); // Set SOC0 to set the interrupt 1 flag. Enable the interrupt and make // sure its flag is cleared. ADC_setInterruptSource(ADCB_BASE, ADC_INT_NUMBER2, ADC_SOC_NUMBER1); ADC_enableInterrupt(ADCB_BASE, ADC_INT_NUMBER2); ADC_clearInterruptStatus(ADCB_BASE, ADC_INT_NUMBER2); //ADC_enableContinuousMode(ADCB_BASE, ADC_INT_NUMBER2); ADC_setInterruptSOCTrigger(ADCB_BASE, ADC_SOC_NUMBER1, ADC_INT_SOC_TRIGGER_ADCINT2); ADC_disableInterrupt(ADCB_BASE, ADC_INT_NUMBER2); }

Also, the failure of the ASSERT is most commonly caused by using an invalid argument for one of our driverlib functions. Please step through your code to find which function is causing the problem, and then make sure that your function argument is a valid option.

I am having trouble converting a voltage with the ADC. I would like to continuously update two different voltages on ADCA and ADCB. I've noticed that my code will run through one while loop and then an error (assert) occurs on the second loop on the clear interrupt function (line 113). Here is my code: