patricktran
New Member
Hi there,
Can anyone please help me to write a C code to get the ADC to make a sample for a data acquisition system which has a successive approximation ADC. This is not for any specific MCU, but in general.
The following is requirements:
The ADC control port is at address x7851.
ADC status port is at address x7852.
ADC data port is at address x7853.
Start conversion is bit 3 of control port.
End conversion is bit 0 of the status port.
The control port is bidirectional
The control port is preconfigured;
I dont need to change any other control port bits when starting conversion.
The code should some form of bail-out in case the ADC fails to convert
Thanks
Can anyone please help me to write a C code to get the ADC to make a sample for a data acquisition system which has a successive approximation ADC. This is not for any specific MCU, but in general.
The following is requirements:
The ADC control port is at address x7851.
ADC status port is at address x7852.
ADC data port is at address x7853.
Start conversion is bit 3 of control port.
End conversion is bit 0 of the status port.
The control port is bidirectional
The control port is preconfigured;
I dont need to change any other control port bits when starting conversion.
The code should some form of bail-out in case the ADC fails to convert
Thanks