Hi,
I am using the TMS570LS1227, CCS6 and halcogen 4.1
I have an input line coming in to AD1IN[12]. I need to monitor it like it is gio, it will either be high or low. I was thinking I could read in the data and if it is above a threshold call it a 1, if not call it 0. However, I can't seem to get a valid ADC reading. Can someone verify my halcogen setup and code?
Halcogen:
Enable ADC1 driver
I thought I would need to mux the pin as it looks like it is shared with AD2IN[12] , but I don't see it on the pinmux tab.
Under the ADC1 Tab:
ADC1 group event:
fifo size - 1
rising edge
checked enable pin 12
ADC1 Group 1 tab:
fifo size - 1
rising edge
software trigger
enable pin 12
my code to start a reading and get the result is
void main(void) { /* USER CODE BEGIN (3) */ uint32 ch_count=0; uint32 id =0; uint32 value =0; adcInit(); adcData_t data; adcStartConversion(adcREG1, 1); while((adcIsConversionComplete(adcREG1,adcGROUP1))==0); ch_count = adcGetData(adcREG1, 1, &data); id = data.id; value = data.value; /* USER CODE END */
but it always returns 0 regardless of the input for the id and value, but ch_count is 1. I tried following the Halcogen example.
Any idea what I am doing wrong?