const dut = 127; reset dut // increase power ONLY FOR THE TEST, otherwise don't use this part !!! const hipower = 0; write NIODE, hipower; write NIOCE, hipower; write NIIDE, hipower; write NIICE, hipower; write ADCEN, hipower; write FILCLK, hipower; // end nop // ***************************** //< configuration for the SADC > // ***************************** // slow control ADC auto zero write dut, SADCAZ, 1 // SADC power write dut, SADCPWR, 7; // 0..7 // SADC meas cycles write dut, SADCMC, 10 // SADC offset meas cycles write dut, SADCOC, 1 // SADC gain table // ch 7 6 5 4 3 2 1 0, > 7 means bypass // here is the best setting to measure T and 1.8Va, 1.8Vd, 3.3V write dut, SADCGTB, 0x87788722 expect dut, SADCGTB, 0x87788722 // gain 2 = attenuation factor 0.6 // gain 7 = attenuation factor 0.23 // prepare to control manually the mux and the ADC write SADCEC, 0x42; // ***************************** // end of the configuration // ***************************** restrict 0 //write SADCRUN, 1 // This part demonstrates how to measure the three voltages. write SADCEC, 0 write SADCTRG, 0 write SADCRUN, 0 restrict 0 write SADCTRG, 1 // read 1.8V digital // now reading the results of the before last trigger! // if no measurement was started before, just ignore these values! read dut, 0x3168 // read 1.8V analog read dut, 0x3169 // read 3.3V read dut, 0x316A // start again write SADCTRG, 0 // read 1.8V digital read dut, 0x3168 // read 1.8V analog read dut, 0x3169 // read 3.3V read dut, 0x316A restrict 1 // prepare to control manually the mux and the ADC write SADCEC, 0x46; adcch=0; include ./SRC/sadc_meas.tcs adcch=1; include ./SRC/sadc_meas.tcs adcch=2; include ./SRC/sadc_meas.tcs adcch=4; include ./SRC/sadc_meas.tcs