Forums

Similar to single step issue, but now with ADC

Started by hc08jb8 February 6, 2005


Hi Guys

I am using the 56F8300Demo board with efield. I am trying to measure
the E-feild sensor's value. On the board the ADC is hooked up to
Channel 4. The slection of the active electrode is done by setting an
appropriate electrode no at the PORTB4-7.

So I have created a BitsIO bean (for controlling the electrode
selection) called PB and an ADC bean to aquire data from channel 4,
without intterupt, 1 sample , conversion time 5.100uS. I use the
following code to itterate thruough the electrodes 1 thru 9.

for(;;)
{
for(i=1;i<=9;i++)
{
PB_PutVal(i); //Select the electrode
channel = AD1_Measure(TRUE);//measure ADC, method
wait till conversion is complete
AD1_GetValue8(&Value8); //Readn in the values as 8
bit
if(Value8<10){while(AS1_SendChar(Value8)!
=ERR_OK);} //if value is <10, then there is a presense of a
dielectric, so send the value char out.

}
} This code works fine in single stepping and nothing during standalone
run. Unlike the previous time, I have used the methods to wait till
the actions are complete. Any idea what I could be doing wrong?

I did try using while(AD1_Measure(TRUE)==ER_OK) as well, same problem. Secondly, I am also looking at the possibility of a wrong setting in
the bean, like conversion time or something, any clues?

Thanks
Jay