element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum ADAS1000 interfacing by Arduino Uno
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Suggested Answer
  • Replies 4 replies
  • Answers 1 answer
  • Subscribers 392 subscribers
  • Views 811 views
  • Users 0 members are here
Related

ADAS1000 interfacing by Arduino Uno

hasan2015
hasan2015 over 10 years ago

Hello everyone,

 

Is it possible to make SPI communication by   Arduino Uno to ADAS1000?

. This is the datasheet link.

http://www.analog.com/media/en/technical-documentation/data-sheets/ADAS1000_1000-1_1000-2.pdf


I am really disappointing to write SPI code. I am a new arduino user.

I have some problem in writing SPI code in Arduino IDE as follows.


1. How to configure ECGCTL, LOFFCTL,RESPCTL,LOFF,CRC etc register in functional code?

2.  I need to receive all electrode ECG signal  for RL,LL,LA, V1,V2, so need to configure all register relating respiration, pace etc.

3. For start with as you said, to call SPI read or write function N number of times to generate SPI clock and read the 32 bit or higher bit data’s (32/N number of times). Can you  give me sample code idea?

4. How to write data in buffer ?

5. Can you explain DRDY function in code? Should we need interrupt   ?

 

  • Sign in to reply
  • Cancel

Top Replies

  • neilk
    neilk over 10 years ago +1 suggested
    Hi hasan2015 If you are new to Arduino, you might want to try Googling "Arduino SPI tutorial" You'll find a lot of useful stuff to get you started. The ADAS1000 looks like an amazing device. Good luck…
Parents
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago

    The simple answer it yet it is very possible

     

    If you look here, you will see some examples of my using an UNO to talk to a TI SPI DAC  http://www.element14.com/community/groups/arduino/blog/2015/07/28/arduino-and-how-to-drive-the-dac8734-from-ti-aka-the-dac8734evm-road-test-board

    the principals are the same, just the commands will change

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago

    The simple answer it yet it is very possible

     

    If you look here, you will see some examples of my using an UNO to talk to a TI SPI DAC  http://www.element14.com/community/groups/arduino/blog/2015/07/28/arduino-and-how-to-drive-the-dac8734-from-ti-aka-the-dac8734evm-road-test-board

    the principals are the same, just the commands will change

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • hasan2015
    0 hasan2015 over 9 years ago in reply to Robert Peter Oakes

    Dear Sir,

    Thank you very much. You looks experienced engineer and helpful.

     

    The device I am talking about its ADAS1000, http://www.analog.com/media/en/technical-documentation/data-sheets/ADAS1000_1000-1_1000-2.pdf

    Its SPI protocol is little complected as 4 bytes data has to be  read,send, receive at a same time. 




    ADAS1000 datasheet gives the SPI  configuration in page 50-52. For 2kHz setting there is frame or data packet rate. Dont you think, clock divider datamode ect for Arduino Uno should be added? How about serial braud rate?

    Besides CS pin, if you look in clock at figure 2 there is another pin called DRDY (data ready pin) . The logic is it should be always LOW when CS is HIGH. How to define this function in  code? Should we need inturrupt for DRDY pin?


    You can see there is 16 bit or 24 bit data format. According to 28 table the ECGTCL register adress is 0x01 and if you arrange this Enable mode from the bottom of the column  like 1000110...... (for example), it make sense. Now question is how to read and write this data? What should be ADAS 1000 read and write command for this register?

     

    I saw ADAS1000 SPI is done by  YRDKRX62N(https://wiki.analog.com/resources/tools-software/uc-drivers/renesas/adas1000)  eval board which is more complicated code having different main file and header. They tried to manage all device configuration.


    Here we go ...kindly help me to make correction please, I

     

    // SPI

    #define DOUT 11 //MOSI

    #define DIN 12 //MISO

    #define SPICK 13 //SCK

     

    // pins

    #define PIN_CS    7

    #define PIN_DRDY  6

     

    // the ADAS communicates using SPI, so include the library:

    #include <SPI.h>

     

     

    int DRDY = 6;

    int CS = 7;

     

    union FourByte{

       struct {

         unsigned long value:32; //32bit register values go in here

         byte command:8; //8bit command goes in here.

       };

       byte bit8[4]; //this is just used for efficient conversion of the above into 4 bytes.

    };

     

    void setup() {

      Serial.begin(115200);

     

      // start the SPI library:

      SPI.begin();

      SPI.setDataMode(SPI_MODE3);

      SPI.setClockDivider(SPI_CLOCK_DIV16);

      SPI.setBitOrder(MSBFIRST);

     

      // initalize the  data ready and chip select pins:

      pinMode(DRDY, INPUT);

      pinMode(CS, OUTPUT);

     

    }

     

    void loop(){

    unsigned long register = SPI_read(0x01);

    Serial.print("register=");

    Serial.println(register);

    delay(100);

    }

     

    void SPI_write(union FourByte data) {

    digitalWrite(CS,LOW); //Using CS pin, so sync1/sync0 bytes not needed

    for(char i = 3; i >= 0; i--){

       SPI.transfer(data.bit8); //transfer all 4 bytes of data - command first, then Big Endian transfer of the 32bit value.
    }
    digitalWrite(CS,HIGH);
    }

    unsigned long SPI_read(byte command){
    digitalWrite(CS,LOW); //SS goes low to mark start of transmission
    union FourByte data = {0xF804BE,command}; //generate the data to be sent, i.e. your command plus the Sync bytes.
    for(char i = 3; i >= 0; i--){
       data.bit8 = SPI.transfer(data.bit8); //send the data whilst reading in the result
    }
    digitalWrite(CS,HIGH); //SS goes high to mark end of transmission
    return data.value; //return the 32bit value recieved.
    }

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube