ADC logging with demo drive board for calibration ADC read synchronised with heater on time
Dependencies: mbed MODSERIAL FastPWM ADS8568_ADC
Diff: main.cpp
- Revision:
- 20:c061539b31c7
- Parent:
- 17:25831977b98e
diff -r c8e67359370a -r c061539b31c7 main.cpp --- a/main.cpp Thu Sep 19 16:19:37 2019 +0000 +++ b/main.cpp Fri Sep 20 09:08:10 2019 +0000 @@ -24,16 +24,16 @@ unsigned long drive_board_uid[UID_TABLE_LENGTH][3] = {{0x005B0060, 0x32375101, 0x32363531}, - {0x00000000, 0x00000000, 0x00000000}, - {0x00000000, 0x00000000, 0x00000000}, - {0x00000000, 0x00000000, 0x00000000}}; + {0x0051003D, 0x32375114, 0x30333732}, + {0x00520060, 0x32375101, 0x32363531}, + {0x00570060, 0x32375101, 0x32363531}}; float drive_board_cal[UID_TABLE_LENGTH][2] = {{0.0, 1.0}, - {0.0, 1.0}, - {0.0, 1.0}, + {0.059473025, 10.14814327}, + {0.01887149, 10.39360225}, {0.0, 1.0}}; - + MODSERIAL pc(PA_9, PA_10, BUFFER_SIZE); //mcu TX, RX, BUFFER_SIZE byte TX and RX buffers ADS8568_ADC adc(PB_15, PB_14, PB_13, PB_12, PC_15, PC_0, PC_1, PC_2, PC_3); @@ -145,7 +145,7 @@ //Write output for iHeater - pc.printf("%10d, %10d, %10.6f, %10.6f", curr[iHeater], v[iHeater], r_adc[iHeater], r_ohm[iHeater]); + pc.printf("%10d, %10d, %10.6f, %10.6f,", curr[iHeater], v[iHeater], r_adc[iHeater], r_ohm[iHeater]); } pc.printf("\n"); wait_ms(LOG_INTERVAL);