some handy dandy functions and constants for interfacing with ADS1198 from texas semiconductor corp
Diff: ADSlib.cpp
- Revision:
- 3:8c8ce127f100
- Parent:
- 2:e3a7ca6b9405
- Child:
- 4:b251aa7b7c86
diff -r e3a7ca6b9405 -r 8c8ce127f100 ADSlib.cpp --- a/ADSlib.cpp Thu Apr 02 13:27:22 2015 +0000 +++ b/ADSlib.cpp Sun Apr 05 20:33:43 2015 +0000 @@ -1,19 +1,20 @@ #include "ADSlib/ADSlib.h" +#include "mbed.h" unsigned char ADS_Default_Register_Settings [22] = { - 0x06, // Config1 + 0x64, // Config1 0x20, // Config2 0xC0, // Config3 0x00, // loff - 0x00, // ch1set - 0x00, // ch2set - 0x00, // ch3set - 0x00, // ch4set - 0x00, // ch5set - 0x00, // ch6set - 0x00, // ch7set - 0x00, // ch8set + 0x60, // ch1set + 0x60, // ch2set + 0x60, // ch3set + 0x60, // ch4set + 0x60, // ch5set + 0x60, // ch6set + 0x60, // ch7set + 0x60, // ch8set 0x00, // rld_sensp 0x00, // rld_sensm 0x00, // loff_sensp @@ -28,22 +29,48 @@ unsigned char ADS_Default_Channel_Settings [8] = { - 0x00, // ch1set - 0x00, // ch2set - 0x00, // ch3set - 0x00, // ch4set - 0x00, // ch5set - 0x00, // ch6set - 0x00, // ch7set - 0x00 // ch8set + 0x60, // ch1set + 0x60, // ch2set + 0x60, // ch3set + 0x60, // ch4set + 0x60, // ch5set + 0x60, // ch6set + 0x60, // ch7set + 0x60 // ch8set }; /**************************************************************************/ -unsigned char ADS_Alternative_WCT_Settings [2] = +unsigned char Input_dummy_byte [19] = { - 0x00, // wct1 - 0x00 // wct2 + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00 +}; +/*****************************************************************************/ -}; -/**************************************************************************/ \ No newline at end of file +void pause_clk(int k){ + k=k/2; + wait_us(k); +} + +void pause_sclk(int k){ + wait_us(k); +} +