Omega Speaker Systems OME-DB-889D manual Example Program, DEMO01.C

Page 23

5.3 Example Program

DEMO_01.C

/* ============== Using OME-A-822 / connect one OME-DB-889D

=================*/

#include <stdio.h> #include “A822.h”

main(void)

{int data1,data2; float vol1,vol2;

A822_Initialize(0,0x220,-1,-1);

/* OME-A-822 Base address in 0x220 ref. OME-A-822 Software manual */

for(;;)

{

/*===============reading OME-DB-889D Channel 0 , Gain =1

=============*/

A822_AD_SetChGainMode(0,0,1);

 

/* Setup OME-A-822 A/D channel 0, Gain = 1 , Polling mode

 

*/

A822_DO(0x0010);

 

/* Send D/O data to OME-DB-889D , Channel 0, Gain=1 */

delay(10);

/* delay about 43u sec . Ref. Page 3 Settling time */

data1=A822_AD_PollingVar();

/* Reading OME-A-822 A/D data */ vol1=(float)((data1-2048)*5/2048); printf(“OME-DB-889D channel 0= %6.4f V\n”,vol1);

/*===========reading OME-DB-889D Channel 1 , Gain=10

===============*/

A822_AD_SetChGainMode(0,0,1);

/* Setup OME-A-822 A/D channel 0, Gain = 1 , Polling mode */

OME-DB-889D User’s Manual

21

Image 23
Contents User’sGuide Servicing North America OME-DB-889D User’s Manual Applications FeaturesSpecification OME-DB-889D Multiplexer Board Function DescriptionFSR Layout Installing1 JP0 ~ JP15 Analog Input R/C Filter Jumper setup3 JP19 Internal / External Power selection Local Gain Control Sw1 Pin Assignment Page Input Channel Selection Analog input & Gain settingGain Setting Gain = OME-A-82X Gain X OME-DB-889D Gain Thermocouple InputVoltage to Temperature Conversion TC = V*1000/24.4 CJC OutputFloating Signal Connection Signal ConnectionNon-Floating Signal Source OME-A-82X OME-DB-889D Cascading OME-DB-889DOpen Thermocouple Detection Block Diagram Programming Using OME-A-822PGLDEMO01.C Example ProgramPage Calibration Steps CalibrationCalibration VR Description WARRANTY/DISCLAIMER Temperature