Difference between revisions of "Component: ADC (AD7680) (Analog Input)"

From Flowcode Help
Jump to navigationJump to search
Line 21: Line 21:
  
 
===Overview===
 
===Overview===
The AD7680 is a 2.5V to 5.5V general purpose SPI compatible, successive
+
The AD7680 is a 2.5V to 5.5V SPI compatible, successive
 
approximation analogue to digital converter (ADC).  
 
approximation analogue to digital converter (ADC).  
 +
 
The reference for the AD7680 is taken internally from VDD  
 
The reference for the AD7680 is taken internally from VDD  
  

Revision as of 19:56, 11 August 2021


Author Matrix TSL
Version 1.0 (Release)
Category Analog Input


Image ADC (AD7680) component

16-bit external ADC connected to the microcontroller using SPI.

Detailed description

Overview

The AD7680 is a 2.5V to 5.5V SPI compatible, successive approximation analogue to digital converter (ADC).

The reference for the AD7680 is taken internally from VDD


Pin reference from the datasheet:

AD7680 Pin Reference.png

Examples

This example reads the voltage on the AD7680 Vin and converts the ADC results into a voltage. For the result to be correct, you must change the Voltage variable to match the supply voltage.

FC6 Icon.png AD7680 Demo

Circuit Diagram

AD7680 Circuit Diagram.png


Downloadable macro reference

SampleADC

Reads the ADC and returns the reading as an unsigned 16-bit value.

Range: 0-65535 / 0=0V / 65535=VCC

Parameters

This macro has no parameters


Return value

UINT


Initialise

Initialise the SPI bus ready for communications,

Parameters

This macro has no parameters


Return value

This call does not return a value


Simulation macro reference

This component does not contain any simulation macros


Property reference

Channel

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::CHANNEL.

SPI Channel selector

Prescale

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::PR_SCALE.

Prescale option selector

MOSI

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::MOSI.

SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.

MISO

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::MISO.

SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.

CLK

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::CLK.

SPI Clock Pin CLK - The Clock signal is driven by the SPI master.

CS / SS

This property is of type Single digital pin and can be referenced with the variable name cal_spi1::SS.

Chip Select / Slave Select Pin

Master Mode: General purpose output pin used to select the remote SPI device.

Slave Mode: Hardware chip select pin input used to select the SPI device.

Simulate Comms

This property is of type True or false and can be referenced with the variable name SimulateComms.

No additional information


Console Data

This property is of type True or false and can be referenced with the variable name cal_spi1::ConsoleData.

Selects if the console data is automatically generated or not

Scope Traces

This property is of type True or false and can be referenced with the variable name cal_spi1::ScopeTraces.

Selects if the scope traces are automatically generated or not

Injector

This property is of type Fixed list of ints and can be referenced with the variable name cal_spi1::Injector.

No additional information