Show Posts
Pages: [1]
1  Using Arduino / Networking, Protocols, and Devices / SPI communications to ADC on: May 06, 2014, 09:03:28 pm
I am having difficulty connecting to an AD7731 24 bit ADC on the SPI bus. I am not completely familliar with the SPI communication.

In the application notes, this pseudo code is given:
Code:
Write 03 Hex to Serial Port 1
Write 1332 Hex to Serial Port 1
Write 02 Hex to Serial Port1
Write B174 Hex to Serial Port1   
Wait for RDY Low
Write 02 Hex to Serial Port1
Write 9174 Hex to Serial Port1 
Wait for RDY Low

 As I read the SPI notes for the arduino and other SPI examples, I *think* it should be:
Code:
   digitalWrite(_cs,LOW);
   SPI.transfer(0x03);
   digitalWrite(_cs,HIGH);
   digitalWrite(_cs,LOW);
   SPI.transfer(0x13);
   SPI.transfer(0x32);
   digitalWrite(_cs,HIGH);
   digitalWrite(_cs,LOW);
   SPI.transfer(0x02);
   digitalWrite(_cs,HIGH);
   digitalWrite(_cs,LOW);
   SPI.transfer(0xB1);
   SPI.transfer(0x74);
   digitalWrite(_cs,HIGH);
   delay(1000);  // wait a second as we are not looking at the RDY pin
     digitalWrite(_cs,LOW);
   SPI.transfer(0x02);
   digitalWrite(_cs,HIGH);
   digitalWrite(_cs,LOW);
   SPI.transfer(0x91);
   SPI.transfer(0x74);
   digitalWrite(_cs,HIGH);
   delay(1000);   // ditto no RDY pin

Can anyone confirm that I have this correct? Do I need to go hi then low again before every sent command?

Keith
2  Products / Arduino Due / Re: [ now published on github ] Building a CAN API for Arduino DUE on: March 14, 2013, 10:33:52 pm
AdderD

Thanks! I'll wait and see what happens. Please post back to this thread when you get it resolved.

Regards,

Keith
3  Products / Arduino Due / Re: [ now published on github ] Building a CAN API for Arduino DUE on: March 14, 2013, 08:13:52 pm
This is a very interesting topic to me, but I cannot see a way to get this library so I can start playing with it. I can figure out how to download the whole fork, but not just the CAN library. Do I need all of it? I have the latest 1.5.x and was hoping to just add this library so I could start investigating.

I want to create a version of this:
http://mbed.org/users/Just4pLeisure/code/Just4Trionic/

but using Due as a basis instead of the LPC chip.

Looking for help to get started with this.

Keith
4  Topics / Science and Measurement / Re: Frequency Counter Library on: July 31, 2012, 08:55:28 am
A bit confused. I grabbed the 'latest' version which appears to be V1.2. Will it work with a 2560, or do I need to use the cpp that Doug contributed above?
Pages: [1]