{"id":2563,"date":"2015-06-25T19:23:32","date_gmt":"2015-06-25T19:23:32","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=2563"},"modified":"2015-06-25T22:10:22","modified_gmt":"2015-06-25T22:10:22","slug":"ltc1859cg-evaluation-board-with-an-arduino","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2015\/06\/ltc1859cg-evaluation-board-with-an-arduino\/","title":{"rendered":"LTC1859CG Evaluation board with an Arduino"},"content":{"rendered":"<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2015\/06\/arduino_ltc1859.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2015\/06\/arduino_ltc1859.jpg\" alt=\"arduino_ltc1859\" width=\"800\" height=\"450\" class=\"aligncenter size-full wp-image-2564\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2015\/06\/arduino_ltc1859.jpg 800w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2015\/06\/arduino_ltc1859-300x169.jpg 300w\" sizes=\"auto, (max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n<p>I&#8217;ve been playing with a LTC1859 Evaluation board. Linear supply code for their Linduino platform (which costs a lot) and a cable to connect to it. However the Linduino is really just a standard Arduino with a special connector. I wired up the SPI interface to the board as shown above and it works fine (a couple of the ground connections are not connected above, I needed to connect them all before the board was stable). The code adapted from the Linduino library and their LTC1859 example is in the tarball below:<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2015\/06\/DC682A.tar.gz\">DC682A.tar<\/a><\/p>\n<p>DC682A.ino can be simplified to the following to give a continuous single channel voltage reading:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n#include &lt;Arduino.h&gt;\r\n#include &quot;Linduino.h&quot;\r\n#include &quot;LT_SPI.h&quot;\r\n#include &quot;LT_I2C.h&quot;\r\n#include &quot;LTC1859.h&quot;\r\n#include &lt;SPI.h&gt;\r\n#include &lt;Wire.h&gt;                         \r\n\r\nvoid setup()\r\n{\r\n  uint16_t adc_code; \r\n  \r\n  quikeval_SPI_init();           \/\/ Configure the spi port for 4MHz SCK\r\n  quikeval_SPI_connect();        \/\/ Connect SPI to main data port\r\n  Serial.begin(115200);          \/\/ Initialize the serial port to the PC\r\n}\r\n\r\n\/\/! Repeats Linduino loop\r\nvoid loop()\r\n{\r\n  uint16_t user_command;\r\n  uint16_t adc_command;         \/\/ The LTC1859 command byte    \r\n  uint16_t adc_code = 0;    \/\/ The LTC1859 code\r\n  float adc_voltage;\r\n  uint8_t x, y, startcount, endcount;\r\n\r\n  uint8_t uni_bipolar = LTC1859_BIPOLAR_MODE;\r\n  uint8_t single_ended_differential = LTC1859_SINGLE_ENDED_MODE;\r\n  uint8_t range_low_high = LTC1859_HIGH_RANGE_MODE;\r\n\r\n  startcount=0;\r\n  endcount=0;\r\n  \r\n  float LTC1859_vref = 10; \r\n\r\n  adc_command = LTC1859_CH0 | uni_bipolar | range_low_high;\r\n  LTC1859_read(LTC1859_CS, adc_command, &amp;adc_code);     \/\/ Throws out last reading and starts CH0 conversion\r\n  adc_command = LTC1859_CH0 | uni_bipolar | range_low_high; \/\/ Send channel config for the NEXT conversion to take place\r\n  LTC1859_read(LTC1859_CS, adc_command, &amp;adc_code);   \/\/ Read previous channel conversion (x-1) and start next one (x)\r\n  LTC1859_read(LTC1859_CS, adc_command, &amp;adc_code);   \/\/ Read previous channel conversion (x-1) and start next one (x)\r\n           \r\n  adc_voltage = LTC1859_code_to_voltage(adc_code, LTC1859_vref, range_low_high, uni_bipolar);\r\n \r\n  \/\/Serial.println(adc_code, BIN);\r\n  Serial.print(adc_voltage, 4);\r\n  Serial.println();\r\n  \r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been playing with a LTC1859 Evaluation board. Linear supply code for their Linduino platform (which costs a lot) and a cable to connect to it. However the Linduino is really just a standard Arduino with a special connector. I wired up the SPI interface to the board as shown above and it works fine [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-2563","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-Fl","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/2563","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=2563"}],"version-history":[{"count":3,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/2563\/revisions"}],"predecessor-version":[{"id":2568,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/2563\/revisions\/2568"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=2563"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=2563"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=2563"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}