diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c | 63 |
1 files changed, 57 insertions, 6 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c index e58e1b71e..0ee2c96a0 100644 --- a/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c +++ b/Software/Embedded_SW/Embedded/Drivers/ADC_Sampling/ADC.c @@ -5,6 +5,54 @@ // data, and running the strip chart display. // //***************************************************************************** +/* +Notes: + 12 shared analog input channels + 12-bit precision ADC + Hardware averaging of up to 64 samples + As referred before the ADC has a reference of 3V. + + Voltage reference selected using the VREF field in the ADCCTL register (page 1217) + + J0062 + PIN 21 - AN_IDS_PRESSENS_7 + PIN 9 - GND + + J0252 + PIN 21 - AN_IDS_PRESSENS_1 + PIN 9 - GND + + J0042 + PIN 21 - AN_IDS_PRESSENS_3 + PIN 9 - GND + + +----------------- +void ADCAcquireInit(void) // (MillisecInit) ok + +void ADCAcquireStart(ProcessCallback _callback, uint32_t _period)// (called by MillisecStart) + +//reading Trigger +uint32_t ADC_TriggerCollection(void) // MillisecLoop +//Data Get +void ADC0SS0Handler(void) + + +//---------------------------------------------------- + + +uint32_t ADC_GetReading(int DataItemId)// ADC Data get for a single data read + +Void ADCProcessTask(UArg arg0, UArg arg1) + +void ADCAcquireStop(void) //MillisecStop + +//--------------------------------- + + + for (adc_i = 0; adc_i < MAX_ADC_DEVICES ; adc_i++) + ADC_Data[adc_i] = ADC_GetReading(adc_i); +*/ #include "ADC.h" #include "include.h" @@ -99,7 +147,7 @@ static ProcessCallback processCallBack; //***************************************************************************** // This function starts an ADC Conversion. //static void ADCClockHandle(UArg arg0) -uint32_t ADC_TriggerCollection(void) +uint32_t ADC_TriggerCollection(void) // (called by MillisecLoop) { // // Kick off the next ADC acquisition. When these are done they will @@ -117,7 +165,7 @@ uint32_t ADC_TriggerCollection(void) // ADC Data get for a single data read // //***************************************************************************** -uint32_t ADC_GetReading(int DataItemId) +uint32_t ADC_GetReading(int DataItemId) // // ADC Data get for a single data read { int bufnotinuse; assert (DataItemId<MAX_ADC_DEVICES); @@ -189,13 +237,13 @@ Void ADCProcessTask(UArg arg0, UArg arg1) // acquisition. // //***************************************************************************** -void ADCAcquireInit(void) +void ADCAcquireInit(void) // (called by MillisecInit) { uint32_t ui32Chan, ui32Base, ui32Seq; //Avaraging 8 - MAP_ADCHardwareOversampleConfigure(ADC0_BASE, 8); - MAP_ADCHardwareOversampleConfigure(ADC1_BASE, 8); + //MAP_ADCHardwareOversampleConfigure(ADC0_BASE, 8); + //MAP_ADCHardwareOversampleConfigure(ADC1_BASE, 8); // // Initialize both ADC peripherals using sequencer 0 and processor trigger. // @@ -245,6 +293,9 @@ void ADCAcquireInit(void) MAP_ADCSequenceStepConfigure(ui32Base, ui32Seq, ui32Chan % 8, ui32ChCtl); } + ADCReferenceSet(ADC0_BASE, ADC_REF_EXT_3V); + ADCReferenceSet(ADC1_BASE, ADC_REF_EXT_3V); + if (!isInitialized) { // Create a periodic Clock Instance with _period - triggers the ADC sampling @@ -261,7 +312,7 @@ void ADCAcquireInit(void) // This will start the acquisition running. // //***************************************************************************** -void ADCAcquireStart(ProcessCallback _callback, uint32_t _period) +void ADCAcquireStart(ProcessCallback _callback, uint32_t _period) // (called by MillisecStart) { // // Enable the ADC sequencers |
