<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: possibly working ads1298 biopotential mesurement chip maple code</title>
		<link>http://forums.leaflabs.com/topic.php?id=254</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:22:48 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=254" rel="self" type="application/rss+xml" />

		<item>
			<title>crenn on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-2028</link>
			<pubDate>Mon, 25 Oct 2010 22:16:49 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">2028@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I'm sending multiple bytes to an ADXL345, take a look here:&#60;br /&#62;
&#60;a href=&#34;http://forums.leaflabs.com/topic.php?id=121&#34; rel=&#34;nofollow&#34;&#62;http://forums.leaflabs.com/topic.php?id=121&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Or directly at the code here:&#60;br /&#62;
&#60;a href=&#34;http://www.crennsmind.com/Code/Maple/SPI/ADXL345-Code.txt&#34; rel=&#34;nofollow&#34;&#62;http://www.crennsmind.com/Code/Maple/SPI/ADXL345-Code.txt&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;EDIT: The function you'll want to be looking at is readmbADXL()
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-2025</link>
			<pubDate>Mon, 25 Oct 2010 22:07:23 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">2025@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;The hardware SPI I didn't have a working example for 24 bits. If you would like to write me a working example snippet to load a 24 bit register it might be smaller code afterwards I would have to wait for drdy then clock out the data with the same sclk pin. I wasn't shure if I could turn it back to normal toggleing like that because the data would be clocked directly into the ft2232h not the maple the maple loads the config of 1 then 7 ads198 chips in the full model.&#60;br /&#62;
1 main chip produces the clock and references etc.&#60;br /&#62;
The others use that chips info so the configs are different.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>poslathian on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-2002</link>
			<pubDate>Mon, 25 Oct 2010 19:50:01 +0000</pubDate>
			<dc:creator>poslathian</dc:creator>
			<guid isPermaLink="false">2002@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Great stuff, im glad you got a faster usb link going now.&#60;br /&#62;
was HardwareSPI not working for you?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1946</link>
			<pubDate>Sat, 23 Oct 2010 15:05:59 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1946@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;That still is very useful you can see how 250 samples per second being clock out 24 bits for the status register + 8 X 24 bits for all the measurements then trying to print 24 characters that are 8 bits then line feed is a lot. Their proably was more data being pushed tward print whale it was still printing till the buffer had its data over written or something.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1886</link>
			<pubDate>Thu, 21 Oct 2010 14:27:57 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1886@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello-&#60;/p&#62;
&#60;p&#62;I am sorry that I did not describe my testing in much detail.&#60;/p&#62;
&#60;p&#62;I do not have access to my code at the moment, so I cannot give you the actual code.&#60;/p&#62;
&#60;p&#62;However, I think I used something like this to test SerialUSB.print():&#60;/p&#62;
&#60;blockquote&#62;
&#60;p&#62;long start=0;&#60;br /&#62;
long end=0;&#60;/p&#62;
&#60;p&#62;start=micros();&#60;br /&#62;
SerialUSB.println(analogRead(0), DEC);&#60;br /&#62;
stop= micros();&#60;/p&#62;
&#60;p&#62;SerialUSB.println(stop-micros);&#60;/p&#62;
&#60;/blockquote&#62;
&#60;p&#62;I believe I was getting 6000 microseconds using the analogRead().  If I simply tried SerialUSB.println(1234, DEC) the time was 3000 microseconds.&#60;/p&#62;
&#60;p&#62;This is all from memory, so I could be very far off.&#60;/p&#62;
&#60;p&#62;Hope this is helpful.&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>okie on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1879</link>
			<pubDate>Thu, 21 Oct 2010 13:47:09 +0000</pubDate>
			<dc:creator>okie</dc:creator>
			<guid isPermaLink="false">1879@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;StephenFromNYC: &#34;If my memory is correct I think I timed SerialUSB.print() at around 6000 microseconds.&#34;&#60;/p&#62;
&#60;p&#62;That would probably vary with so many unstated things. Is this a latency plus transaction time?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1873</link>
			<pubDate>Thu, 21 Oct 2010 12:30:10 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1873@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;It apears to be working when I turned on low power mode on the ads1298 sensor board using the registers. It samples at 250 samples per second and now the print statment I am guessing is keeping up.&#60;br /&#62;
The data does not seem to be overwritten with junk or something like it was before.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1862</link>
			<pubDate>Wed, 20 Oct 2010 21:31:39 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1862@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;so what you said about the registers blipping out the wrong value ocationaly if the data was read from the sensor then printed to the screen could be the print not being fast enough and catching on the rest of the code and sensor io?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1858</link>
			<pubDate>Wed, 20 Oct 2010 17:55:47 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1858@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;reading  a serial digital sensor should there be a resistor on its output? the output seems to get random noise random 1s where zeros should be whale its printing the sensors input that should be fixed.ads1298 dout page 13 &#60;/p&#62;
&#60;p&#62;&#34;Specifications apply from 0°C to +70°C. Load on DOUT = 20pF &#124;&#124; 100kΩ.&#34;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1857</link>
			<pubDate>Wed, 20 Oct 2010 17:54:15 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1857@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi I will answer both questions here I am using bitbang spi because the sclk serial clock will drive the data into the ft2232h chip because the maples usb is too slow.&#60;br /&#62;
the ft2232h should be able to clock out 8 chips that are syncronised by the start pin giving 64 channels at 16k samples per second.&#60;br /&#62;
eatch chip has 8 adc's that work in parrellel.&#60;br /&#62;
This is using a single chip almost... ads1298 , maple, ft2232h, usb isolation...&#60;br /&#62;
before the chip outputs its 8 mesurements it sends a status word 24 bits showing 1100 then telling if any of the 16 inputs for the 8 channels is off. Then the status of the GPIO for example I have it set now as a input the 4 bits from the 4 pins shows up as 1111 because their tied to power.&#60;br /&#62;
But I am getting random 0's and 1's in my signal. I don't know where it is comming from.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>StephenFromNYC on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1854</link>
			<pubDate>Wed, 20 Oct 2010 08:41:16 +0000</pubDate>
			<dc:creator>StephenFromNYC</dc:creator>
			<guid isPermaLink="false">1854@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I have been away recently.  Busy with other projects.&#60;/p&#62;
&#60;p&#62;Josh, thank you for posting the code for your open source biopotential project.  Now we understand your username.  I am positive an open ECG/EKG (for cardiology) project exists, but I thought an open EEG (for measuring electrical brain activity) project also exists.&#60;/p&#62;
&#60;p&#62;In the EEG you are building how many channels do you need?  From you code I am guessing nine (which is less than the &#34;standard&#34; EEG).  Do you plan to use two ads1298 chips?&#60;/p&#62;
&#60;p&#62;You said the ads1298 chip can sample at 16000 samples per second.  Is this the rate per channel?  If the chip can do a total of 16 KSps then each channel will be just over 1.6 KSps.  Is this fast enough for your EEG?&#60;/p&#62;
&#60;p&#62;Most commercial ECG/EKG (for cardiology) run at 1 KSps (or greater).&#60;/p&#62;
&#60;p&#62;I believe the maple SerialUSB() code is too slow for your purposes.  If my memory is correct I think I timed SerialUSB.print() at around 6000  microseconds.  This is fast enough for only 160 samples per second.  10X-100X slower than what you might need.&#60;/p&#62;
&#60;p&#62;Do you have any throughput benchmarking to share?  It would be great if my benchmarking is wrong and that you have a way to increase the speed of SerialUSB().&#60;/p&#62;
&#60;p&#62;Good luck with the high speed serial.   Let us know how it works.&#60;/p&#62;
&#60;p&#62;Stephen from NYC
&#60;/p&#62;</description>
		</item>
		<item>
			<title>crenn on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1841</link>
			<pubDate>Tue, 19 Oct 2010 14:35:15 +0000</pubDate>
			<dc:creator>crenn</dc:creator>
			<guid isPermaLink="false">1841@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Why are you doing SPI in software instead of using the hardware? Just curious.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>josheeg on "possibly working ads1298 biopotential mesurement chip maple code"</title>
			<link>http://forums.leaflabs.com/topic.php?id=254#post-1838</link>
			<pubDate>Tue, 19 Oct 2010 11:21:05 +0000</pubDate>
			<dc:creator>josheeg</dc:creator>
			<guid isPermaLink="false">1838@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;possibly working ads1298 biopotential mesurement chip maple code.&#60;br /&#62;
The ads1298 biopotential mesurement chip samples at 16ksps to take all the information in possible from mucle signals.&#60;br /&#62;
To do this after the analog mesurements are fully tested the data out will be connected to the usb1232h module made by dlp that has a high speed usb FT2232h chip. &#60;/p&#62;
&#60;p&#62;but here is the code for my open source project I will check if the GPIO status changes in the firs output 24 bit word. &#60;/p&#62;
&#60;p&#62;next I will use my mp3 player and audacity &#38;amp; the headphone wires going to the board to try to have it mesure a sign wave. &#60;/p&#62;
&#60;p&#62;code main loop and setup function code.&#60;/p&#62;
&#60;blockquote&#62;&#60;pre&#62;&#60;code&#62;&#38;lt;br /&#38;gt;
//set pin names&#38;lt;br /&#38;gt;
int ledPin =  13;      // LED connected to digital pin 13 d13&#38;lt;br /&#38;gt;
int RESET = 11;        //reset pin active reset low d11.&#38;lt;br /&#38;gt;
int START = 10;        //start pin activate conversion when high d11.&#38;lt;br /&#38;gt;
int DRDY = 12;         //active low when data is ready to be read d12.&#38;lt;br /&#38;gt;
int cs_main = 9;       //selects main chip to configure registers d9&#38;lt;br /&#38;gt;
int cs_secondary =8;   //selects non-main chip to configure registers d8&#38;lt;br /&#38;gt;
int sclk=14;          //system clock for all the other pins d14&#38;lt;br /&#38;gt;
int doutMISO_0=0;          //doutMISO of the main chip 1-7 secondary chips master in slave out&#38;lt;br /&#38;gt;
int dinMOSI_0=15;           //data in to main pin Master out slave in&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;//global vareables&#38;lt;br /&#38;gt;
int buttonState=LOW;&#38;lt;br /&#38;gt;
int drdy_State=HIGH;&#38;lt;br /&#38;gt;
int dout_input=LOW;&#38;lt;br /&#38;gt;
int reg_number=0;&#38;lt;br /&#38;gt;
int register_val=0;&#38;lt;br /&#38;gt;
int reg_data=0;&#38;lt;br /&#38;gt;
int sample_1=0;&#38;lt;br /&#38;gt;
int sample_2=0;&#38;lt;br /&#38;gt;
int sample_3=0;&#38;lt;br /&#38;gt;
int sample_4=0;&#38;lt;br /&#38;gt;
int sample_5=0;&#38;lt;br /&#38;gt;
int sample_6=0;&#38;lt;br /&#38;gt;
int sample_7=0;&#38;lt;br /&#38;gt;
int sample_8=0;&#38;lt;br /&#38;gt;
int status_0=0;&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;// The setup() method runs once, when the sketch starts&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;void setup()   {                &#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  SerialUSB.println(&#38;quot;Hello World!&#38;quot;);  //delay setup configure print&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  ads1298_Setup();&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  //Setup Registers&#38;lt;br /&#38;gt;
  setup_registers();&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  delay(1000); //wait 1 s&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  digitalWrite(START, HIGH);&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  //check for drdy change before reading registers...&#38;lt;br /&#38;gt;
  while(drdy_State==HIGH){&#38;lt;br /&#38;gt;
    drdy_State = digitalRead(DRDY);&#38;lt;br /&#38;gt;
    if(drdy_State==LOW){  &#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;      read_n_print_9_words();&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;      digitalWrite(ledPin, HIGH);&#38;lt;br /&#38;gt;
    }&#38;lt;br /&#38;gt;
  }&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;}&#38;lt;br /&#38;gt;
// the loop() method runs over and over again,&#38;lt;br /&#38;gt;
// as long as the Maple has power&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;void loop()&#38;lt;br /&#38;gt;
{&#38;lt;br /&#38;gt;
  drdy_State = digitalRead(DRDY);&#38;lt;br /&#38;gt;
  if(drdy_State==LOW){  &#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;    //show the status of the gpio register over and over..&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;    read_9_words_print_status();&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;  }&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;}&#38;lt;/p&#38;gt;
&#38;lt;p&#38;gt;&#60;/code&#62;&#60;/pre&#62;
&#60;/blockquote&#62;
&#60;p&#62;file 2: function definitions&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
&#60;code&#62;&#60;br /&#62;
//set pin names&#60;br /&#62;
extern int ledPin;     // LED connected to digital pin 13 d13&#60;br /&#62;
extern int RESET;        //reset pin active reset low d10.&#60;br /&#62;
extern int START;        //start pin activate conversion when high d11.&#60;br /&#62;
extern int DRDY;         //active low when data is ready to be read d12.&#60;br /&#62;
extern int cs_main;       //selects main chip to configure registers d9&#60;br /&#62;
extern int cs_secondary;   //selects non-main chip to configure registers d9&#60;br /&#62;
extern int sclk;          //system clock for all the other pins d14&#60;br /&#62;
extern int doutMISO_0;          //doutMISO of the main chip 2-7 secondary chips master in slave out&#60;br /&#62;
extern int dinMOSI_0;           //data in to all other pins Master out slave in&#60;/p&#62;
&#60;p&#62;//global vareables&#60;br /&#62;
extern int buttonState;&#60;br /&#62;
extern int drdy_State;&#60;br /&#62;
extern int dout_input;&#60;br /&#62;
extern int reg_number;&#60;br /&#62;
extern int register_val;&#60;br /&#62;
extern int reg_data;&#60;br /&#62;
extern int sample_1;&#60;br /&#62;
extern int sample_2;&#60;br /&#62;
extern int sample_3;&#60;br /&#62;
extern int sample_4;&#60;br /&#62;
extern int sample_5;&#60;br /&#62;
extern int sample_6;&#60;br /&#62;
extern int sample_7;&#60;br /&#62;
extern int sample_8;&#60;br /&#62;
extern int status_0;&#60;/p&#62;
&#60;p&#62;void ads1298_Setup(void){&#60;br /&#62;
  SerialUSB.println(&#34;ADS1298 power up!&#34;);&#60;br /&#62;
  //setup pins for inputs and outputs&#60;br /&#62;
  pinMode(ledPin, OUTPUT);&#60;br /&#62;
  pinMode(RESET, OUTPUT);&#60;br /&#62;
  pinMode(START, OUTPUT);&#60;br /&#62;
  pinMode(DRDY, INPUT);&#60;br /&#62;
  pinMode(cs_main, OUTPUT);&#60;br /&#62;
  pinMode(cs_secondary, OUTPUT);&#60;br /&#62;
  pinMode(sclk, OUTPUT);&#60;br /&#62;
  pinMode(doutMISO_0, INPUT);&#60;br /&#62;
  pinMode(dinMOSI_0, OUTPUT);&#60;br /&#62;
  //tie all low&#60;br /&#62;
  digitalWrite(START, LOW);&#60;br /&#62;
  digitalWrite(ledPin, LOW);&#60;br /&#62;
  digitalWrite(cs_main, LOW);&#60;br /&#62;
  digitalWrite(cs_secondary, LOW);&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;br /&#62;
  digitalWrite(dinMOSI_0, LOW);&#60;/p&#62;
&#60;p&#62;  ads1298_Power_Up();&#60;/p&#62;
&#60;p&#62;  send_Reset_Command();&#60;/p&#62;
&#60;p&#62;  //send command Stop Read Data Continuously mode&#60;br /&#62;
  sdatac();&#60;/p&#62;
&#60;p&#62;  //comand sent to read = RREG When in RDATAC mode, the RREG command is ignored.&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void ads1298_Power_Up(void){&#60;/p&#62;
&#60;p&#62;  //step 1 wait 500ms instead of recomended 150ms&#60;br /&#62;
  //for power supplies to stableise&#60;br /&#62;
  delay(500);&#60;br /&#62;
  //set CLKSEL=1 wait 20us //allready set to 1 unless tie to pin.&#60;br /&#62;
  delay(500); //wait 500ms instead of 20us to let clk stableise&#60;br /&#62;
  //wait 2^16 tclk = 65536 tclk 2.x Mhz&#60;br /&#62;
  delay(1000); //wait 1 s instead of 65536 tclk&#60;br /&#62;
  //reset pulse low wait 18tclks longer low wait 5 sec for power on reset&#60;br /&#62;
  //reset allready tied HIGH&#60;br /&#62;
  digitalWrite(RESET, LOW);&#60;br /&#62;
  delay(100);&#60;br /&#62;
  digitalWrite(RESET, HIGH);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void sclk_toggle_dinMOSI_0_L(void){&#60;br /&#62;
  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, LOW);&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void sclk_toggle_dinMOSI_0_H(void){&#60;br /&#62;
  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, HIGH);&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void send_Reset_Command(void){&#60;br /&#62;
  //0000 0110&#60;br /&#62;
  //msb first&#60;br /&#62;
  //set configuration registers...&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b7 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b6 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b5 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b4 = 0&#60;/p&#62;
&#60;p&#62;  sclk_toggle_dinMOSI_0_L();//b3 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b2 = 1&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b1 = 1&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b0 = 0&#60;br /&#62;
  //delay after reset&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;br /&#62;
  delay(1000);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void sdatac(void){&#60;br /&#62;
  //SDATAC&#60;br /&#62;
  //0001 0001&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b7 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b6 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b5 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b4 = 1&#60;/p&#62;
&#60;p&#62;  sclk_toggle_dinMOSI_0_L();//b3 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b2 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b1 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b0 = 1&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void rreg (void){&#60;br /&#62;
  //001&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b7 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b6 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b5 = 1&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void rw_byte_1(void){&#60;br /&#62;
  //number of bytes value 0 = read 1 byte&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b7 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b6 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b5 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b4 = 0&#60;/p&#62;
&#60;p&#62;  sclk_toggle_dinMOSI_0_L();//b3 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b2 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b1 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b0 = 0&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void toggle_sclk(void){&#60;br /&#62;
  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void wreg(void){&#60;br /&#62;
  //010&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b7 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b6 = 1&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b5 = 0&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void write_reg(int reg_number, int in){&#60;/p&#62;
&#60;p&#62;  wreg();&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,4));//b4&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,3));//b3&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,2));//b2&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,1));//b1&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,0));//b0&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  rw_byte_1();&#60;/p&#62;
&#60;p&#62;  write_byte_to_reg(in);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void write_byte_to_reg(int reg_data){&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,7));//b7&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,6));//b6&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,5));//b5&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,4));//b4&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,3));//b3&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,2));//b2&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,1));//b1&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_data,0));//b0&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;int sclk_out_byte_ret(void){&#60;/p&#62;
&#60;p&#62;  int out;  &#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b7&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,7,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b6&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,6,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b5&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,5,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b4&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,4,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b3&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,3,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b2&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,2,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b1&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,1,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b0&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,0,dout_input);&#60;/p&#62;
&#60;p&#62;  return(out);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;int read_reg_ret(int reg_number){&#60;/p&#62;
&#60;p&#62;  int out = 0;&#60;/p&#62;
&#60;p&#62;  rreg();&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,4));//b4&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,3));//b3&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,2));//b2&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,1));//b1&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  digitalWrite(sclk, HIGH);&#60;br /&#62;
  digitalWrite(dinMOSI_0, bitRead(reg_number,0));//b0&#60;br /&#62;
  digitalWrite(sclk, LOW);&#60;/p&#62;
&#60;p&#62;  rw_byte_1();&#60;/p&#62;
&#60;p&#62;  out = sclk_out_byte_ret();&#60;/p&#62;
&#60;p&#62;  return(out);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void rdatac(void){&#60;br /&#62;
  //RDATAC&#60;br /&#62;
  //0001 0000 (10h)&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b7 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b6 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b5 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_H();//b4 = 1&#60;/p&#62;
&#60;p&#62;  sclk_toggle_dinMOSI_0_L();//b3 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b2 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b1 = 0&#60;br /&#62;
  sclk_toggle_dinMOSI_0_L();//b0 = 0&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;int sclk_out_word_ret24(void){&#60;br /&#62;
  int out; &#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b23&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,23,dout_input);&#60;br /&#62;
  toggle_sclk();//b22&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,22,dout_input);&#60;br /&#62;
  toggle_sclk();//b21&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,21,dout_input);&#60;br /&#62;
  toggle_sclk();//b20&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,20,dout_input);&#60;br /&#62;
  toggle_sclk();//b19&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,19,dout_input);&#60;br /&#62;
  toggle_sclk();//b18&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,18,dout_input);&#60;br /&#62;
  toggle_sclk();//b17&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,17,dout_input);&#60;br /&#62;
  toggle_sclk();//b16&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,16,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b15&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,15,dout_input);&#60;br /&#62;
  toggle_sclk();//b14&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,14,dout_input);&#60;br /&#62;
  toggle_sclk();//b13&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,13,dout_input);&#60;br /&#62;
  toggle_sclk();//b12&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,12,dout_input);&#60;br /&#62;
  toggle_sclk();//b11&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,11,dout_input);&#60;br /&#62;
  toggle_sclk();//b10&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,10,dout_input);&#60;br /&#62;
  toggle_sclk();//b9&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,9,dout_input);&#60;br /&#62;
  toggle_sclk();//b8&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,8,dout_input);&#60;/p&#62;
&#60;p&#62;  toggle_sclk();//b7&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,7,dout_input);&#60;br /&#62;
  toggle_sclk();//b6&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,6,dout_input);&#60;br /&#62;
  toggle_sclk();//b5&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,5,dout_input);&#60;br /&#62;
  toggle_sclk();//b4&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,4,dout_input);&#60;br /&#62;
  toggle_sclk();//b3&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,3,dout_input);&#60;br /&#62;
  toggle_sclk();//b2&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,2,dout_input);&#60;br /&#62;
  toggle_sclk();//b1&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,1,dout_input);&#60;br /&#62;
  toggle_sclk();//b0&#60;br /&#62;
  dout_input = digitalRead(doutMISO_0);&#60;br /&#62;
  bitWrite(out,0,dout_input);&#60;/p&#62;
&#60;p&#62;  return(out);&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;void setup_registers(void){&#60;/p&#62;
&#60;p&#62;  //READ DEVICE SETTINGS ****************&#60;/p&#62;
&#60;p&#62;  //read register 0&#60;br /&#62;
  register_val=read_reg_ret(0);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 0 Shows 010 at the end 8 channel &#38;amp; ID&#34;);&#60;/p&#62;
&#60;p&#62;  //SET GLOBAL SETTINGS ACROSS CHANNELS *****************&#60;/p&#62;
&#60;p&#62;  //write register address 1 config1&#60;br /&#62;
  //value 10100001=161=high res,daisy chain,osc out,16ksps&#60;br /&#62;
  write_reg(1, 161);&#60;br /&#62;
  //read register 1&#60;br /&#62;
  register_val=read_reg_ret(1);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 1 Shows value 10100001=161=high res,daisy chain,osc out,16ksps&#34;);&#60;/p&#62;
&#60;p&#62;  //write register address 2 config2&#60;br /&#62;
  //value 0000 0000=0=fclk /1&#60;br /&#62;
  write_reg(2, 0);&#60;br /&#62;
  register_val=read_reg_ret(2);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 2 Shows fclk /1&#34;);&#60;/p&#62;
&#60;p&#62;  //write register address 3 config3&#60;br /&#62;
  //value b1100 0100=196=7=en ref buf 2=rld buf en RLD Buffer bit 2&#60;br /&#62;
  write_reg(3, 196);&#60;br /&#62;
  register_val=read_reg_ret(3);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 3 en ref buf 2=rld buf en RLD Buffer bit 2&#34;);&#60;/p&#62;
&#60;p&#62;  //write register address 4 LOFF&#60;br /&#62;
  //value b0000 0000=0=00 = 00 = Lead-off detection turned off (default)&#60;br /&#62;
  write_reg(4, 0);&#60;br /&#62;
  register_val=read_reg_ret(4);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 4 Shows 00 = Lead-off detection turned off (default)&#34;);&#60;/p&#62;
&#60;p&#62;  //CHANNEL SPECIFIC SETTINGS&#60;br /&#62;
  //these will be very similar&#60;br /&#62;
  //write register address 5-12 CH1-8SET&#60;br /&#62;
  //value b0001 0000=16=6:4=001 gain =1&#60;br /&#62;
  write_reg(5, 16);&#60;br /&#62;
  write_reg(6, 16);&#60;br /&#62;
  write_reg(7, 16);&#60;br /&#62;
  write_reg(8, 16);&#60;br /&#62;
  write_reg(9, 16);&#60;br /&#62;
  write_reg(10, 16);&#60;br /&#62;
  write_reg(11, 16);&#60;br /&#62;
  write_reg(12, 16);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(5);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(6);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(7);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(8);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(9);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(10);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(11);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(12);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 5-12 Shows 6:4=001 gain =1&#34;);&#60;/p&#62;
&#60;p&#62;  //ALL BITS EFFECT RLD 13-14 ******&#60;br /&#62;
  //b1111 1111=255&#60;/p&#62;
&#60;p&#62;  write_reg(13, 255);&#60;br /&#62;
  write_reg(14, 255);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(13);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 13 Shows ALL pos BITS EFFECT RLD&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(14);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 14 Shows ALL neg BITS EFFECT RLD&#34;);&#60;/p&#62;
&#60;p&#62;  //Lead off Sense pos, neg, flip&#60;br /&#62;
  //0000 0000 = 0 = turn off &#60;/p&#62;
&#60;p&#62;  write_reg(15, 0);&#60;br /&#62;
  write_reg(16, 0);&#60;br /&#62;
  write_reg(17, 0);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(15);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 15 Shows sens pos. off&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(16);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 16 Shows sens neg. off&#34;);&#60;/p&#62;
&#60;p&#62;  register_val=read_reg_ret(17);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 17 Shows sens flip. off&#34;);&#60;/p&#62;
&#60;p&#62;  //lead off status registers 18 &#38;amp;19&#60;br /&#62;
  //read only&#60;/p&#62;
&#60;p&#62;  //GPIO &#38;amp; Other&#60;br /&#62;
  //20-25&#60;/p&#62;
&#60;p&#62;  write_reg(20, 15);//GPIO = 15=1111 = input status registers will show values.&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 20 GPIO = 0 = output&#34;);&#60;br /&#62;
  write_reg(21, 0);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 21 Pace&#34;);&#60;br /&#62;
  write_reg(22, 0);//RESPETORY = 0 = respetory circuit off&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 22 Shows RESPETORY = 0 = respetory circuit off&#34;);&#60;/p&#62;
&#60;p&#62;  //reg 23 has read continuous it cant be set till&#60;br /&#62;
  //all other registers be set &#60;/p&#62;
&#60;p&#62;  write_reg(24, 0);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 24 WCT1&#34;);&#60;br /&#62;
  write_reg(25, 0);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 25 WCT2&#34;);&#60;/p&#62;
&#60;p&#62;  write_reg(23, 0);&#60;br /&#62;
  SerialUSB.print(register_val,BIN);&#60;br /&#62;
  SerialUSB.println(&#34; Register 23 Config4&#34;);&#60;/p&#62;
&#60;p&#62;  //rdatac shows continuous conversion after start doen't it ignore commands?&#60;br /&#62;
  rdatac();&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void read_n_print_9_words(void){&#60;/p&#62;
&#60;p&#62;  status_0=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(status_0, BIN);&#60;/p&#62;
&#60;p&#62;  sample_1=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_1, BIN);&#60;br /&#62;
  sample_2=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_2, BIN);&#60;br /&#62;
  sample_3=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_3, BIN);&#60;br /&#62;
  sample_4=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_4, BIN);&#60;br /&#62;
  sample_5=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_5, BIN);&#60;br /&#62;
  sample_6=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_6, BIN);&#60;br /&#62;
  sample_7=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_7, BIN);&#60;br /&#62;
  sample_8=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(sample_8, BIN);&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;void read_9_words_print_status(void){&#60;/p&#62;
&#60;p&#62;  status_0=sclk_out_word_ret24();&#60;br /&#62;
  SerialUSB.println(status_0, BIN);&#60;br /&#62;
  sample_1=sclk_out_word_ret24();&#60;br /&#62;
  sample_2=sclk_out_word_ret24();&#60;br /&#62;
  sample_3=sclk_out_word_ret24();&#60;br /&#62;
  sample_4=sclk_out_word_ret24();&#60;br /&#62;
  sample_5=sclk_out_word_ret24();&#60;br /&#62;
  sample_6=sclk_out_word_ret24();&#60;br /&#62;
  sample_7=sclk_out_word_ret24();&#60;br /&#62;
  sample_8=sclk_out_word_ret24();&#60;/p&#62;
&#60;p&#62;}&#60;/p&#62;
&#60;p&#62;&#60;/code&#62;
&#60;/p&#62;&#60;/blockquote&#62;</description>
		</item>

	</channel>
</rss>
