The AD7193 is a low noise, complete analog front end for high precision measurement applications. It contains a low noise, 24-bit sigma-delta (Σ-Δ) analog-to-digital converter (ADC). The on-chip low noise gain stage means that signals of small amplitude can interface directly to the ADC.
The device can be configured to have four differential inputs or eight pseudo differential inputs. The on-chip channel sequencer allows several channels to be enabled simultaneously, and the AD7193 sequentially converts on each enabled channel, simplifying communication with the part. The on-chip 4.92 MHz clock can be used as the clock source to the ADC or, alternatively, an external clock or crystal can be used. The output data rate from the part can be varied from 4.7 Hz to 4.8 kHz.
The device has a very flexible digital filter, including a fast settling option. Variables such as output data rate and settling time are dependent on the option selected. The AD7193 also includes a zero latency option.
The part operates with a power supply from 3 V to 5.25 V. It consumes a current of 4.65 mA, and it is available in a 28-lead TSSOP package and a 32-lead LFCSP package.
The goal of this project (Microcontroller No-OS) is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. Here you can find a generic driver which can be used as a base for any microcontroller platform and also specific drivers for different microcontroller platforms.
The driver contains two parts:
The Communication Driver has a standard interface, so the AD7193 driver can be used exactly as it is provided.
There are three functions which are called by the AD7193 driver:
SPI driver architecture
The following functions are implemented in this version of AD7193 driver:
|char AD7193_Init(void)||Checks if the AD7139 part is present.|
|void AD7193_SetRegisterValue(unsigned char registerAddress, unsigned long registerValue, unsigned char bytesNumber, unsigned char modifyCS)||Writes data into a register.|
|unsigned long AD7193_GetRegisterValue(unsigned char registerAddress, unsigned char bytesNumber, unsigned char modifyCS)||Reads the value of a register.|
|void AD7193_Reset(void)||Resets the device.|
|void AD7193_SetPower(unsigned char pwrMode)||Set device to idle or power-down.|
|void AD7193_WaitRdyGoLow(void)||Waits for RDY pin to go low.|
|void AD7193_ChannelSelect(unsigned short channel)||Selects the channel to be enabled.|
|void AD7193_Calibrate(unsigned char mode, unsigned char channel)||Performs the given calibration to the specified channel.|
|void AD7193_RangeSetup(unsigned char polarity, unsigned char range)||Selects the polarity of the conversion and the ADC input range.|
|unsigned long AD7193_SingleConversion(void)||Returns the result of a single conversion.|
|unsigned long AD7193_ContinuousReadAvg(unsigned char sampleNumber)||Returns the average of several conversion results.|
|float AD7193_TemperatureRead(void)||Read data from temperature sensor and converts it to Celsius degrees.|
|float AD7193_ConvertToVolts(unsigned long rawData, float vRef)||Converts 24-bit raw data to volts.|