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

From Flowcode Help
Jump to navigationJump to search
Line 16: Line 16:
  
 
==Detailed description==
 
==Detailed description==
 +
 +
  
  
Line 37: Line 39:
  
 
==Examples==
 
==Examples==
 +
 +
  
  

Revision as of 13:32, 17 November 2021

Author Matrix TSL
Version 1.0
Category Analog Input


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

Fc9-comp-macro.png SampleADC
Reads the ADC and returns the reading as an unsigned 16-bit value. Range: 0-65535 / 0=0V / 65535=VCC  
Fc9-u16-icon.png - UINT Return


Fc9-comp-macro.png Initialise
Initialise the SPI bus ready for communications, 
Fc9-void-icon.png - VOID Return



Property reference

Fc9-prop-icon.png Properties
Fc9-type-16-icon.png Channel
SPI Channel selector 
Fc9-type-16-icon.png Prescale
Prescale option selector 
Fc9-type-5-icon.png MOSI
SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. 
Fc9-type-5-icon.png MISO
SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. 
Fc9-type-5-icon.png CLK
SPI Clock Pin CLK - The Clock signal is driven by the SPI master. 
Fc9-type-5-icon.png CS / 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.  
Fc9-type-7-icon.png Console Data
Selects if the console data is automatically generated or not 
Fc9-type-7-icon.png Scope Traces
Selects if the scope traces are automatically generated or not 
Fc9-type-16-icon.png API
 
Fc9-conn-icon.png Connections
Fc9-conn-icon.png Simulations
Fc9-type-7-icon.png Data Recorder Trace
 
Fc9-type-7-icon.png Simulate Comms