12-Bit Incremental ADC Datasheet ADCINC12 V 5.3 (Cypress) - 19

ManufacturerCypress
DescriptionThe ADCINC12 User Module implements a 12-bit incremental A/D that generates a 12-bit, full-scale 2's complement output (+2047 to -2048 count range) with several input ranges to select from. Input voltage ranges, including rail-to-rail, may be measured by configuring the proper reference voltage and analog ground. It supports sample rates from 7.8 sps to 480 sps
Pages / Page23 / 19 — ADCINC12_ClearFlag. Description:. C Prototype:. Assembly:. Parameters:. …
File Format / SizePDF / 394 Kb
Document LanguageEnglish

ADCINC12_ClearFlag. Description:. C Prototype:. Assembly:. Parameters:. Return Value:. Side Effect:. Sample Firmware Source Code

ADCINC12_ClearFlag Description: C Prototype: Assembly: Parameters: Return Value: Side Effect: Sample Firmware Source Code

Text Version of Document

12-Bit Incremental ADC
ADCINC12_ClearFlag Description:
Resets the data-available flag.
C Prototype:
void ADCINC12_ClearFlag(void)
Assembly:
lcall ADCINC12_ClearFlag
Parameters:
None
Return Value:
None
Side Effect:
The A and X registers may be modified by this or future implementations of this function. The same is true for all RAM page pointer registers in the Large Memory Model (CY8C29xxx). When necessary, it is the calling function's responsibility to preserve the values across calls to fastcall16 functions. Currently, only the CUR_PP page pointer register is modified.
Sample Firmware Source Code
The sample code polls the Flag register and sends the data to a routine that shifts the data out one of the I/O pins. ;;; Sample Code for the ADCINC12 ;;; Continuously Sample and Output Data to a pin. ;;; ;;; The user must provide the function to shift the data out. ;;; include "m8c.inc" part specific constants and macros include "PSoCAPI.inc" PSoC API definitions for all User Modules export _main _main: M8C_EnableGInt ; enable global interrupts mov a,ADCINC12_HIGHPOWER ; set Power call ADCINC12_Start mov a,00h ; set ADC to continuous sampling call ADCINC12_GetSamples loop1: wait: call ADCINC12_fIsDataAvailable ; poll flag jz wait call ADCINC12_ClearFlag ; reset flag call ADCINC12_iGetData ; retrieve the data ;; call shift_it_out ; (user provided) send data to output pin Document Number: 001-13252 Rev. *H Page 19 of 23 Document Outline Features and Overview Functional Description Example 1 Example 2 Incremental ADC DC and AC Electrical Characteristics CY8C29xxx Typical Performance Placement Parameters and Resources Example 1 Example 2 Interrupt Generation Control Application Programming Interface ADCINC12_Start ADCINC12_SetPower ADCINC12_Stop ADCINC12_GetSamples ADCINC12_StopAD ADCINC12_fIsDataAvailable ADCINC12_iGetData ADCINC12_ClearFlag Sample Firmware Source Code Configuration Registers Version History