|
Hi Dasq,
Okay,
I now hooked up my 300uS line to an AND gate, the other input is coming from a timer that kicks in every 60uS, then the output from that AND gate goes to the soc of my ADC which is configured to 10bits at a conversion rate of 17000 SPS in Single Sample mode. My code looks like this:
while(1)
{
LCD_Position(0, 0);
LCD_PrintString("IRfeedback ");
/* Place your application code here. */
//for(i = 0; i<=2; i++){
/* Wait for end of conversion */
ADC_IsEndConversion(ADC_WAIT_FOR_RESULT);
IRfeedback = ADC_GetResult16();
if (IRfeedback < MIN_COUNT)
{
IRfeedback = MIN_COUNT;
}
/* Used to remove the count beyond 8 bit value, see resolution section
* in DelSig ADC datasheet */
else if(IRfeedback > MAX_COUNT)
{
IRfeedback = MAX_COUNT;
}
else
{
/* Continue */
}
//}
AVGfeedback = IRfeedback;
LCD_Position(0, 11);
LCD_PrintNumber(AVGfeedback);
}
It seems like it's reading the value once only and then it would get stuck in ADC_IsEndConversion(ADC_WAIT_FOR_RESULT) and not get out of there anymore but if I hook up a debug pin to the ADC's soc, I can clearly see 5 pulses with my scope. What am I doing wrong?
Hints or suggestions appreciated!
Thank you!
roN
|