would you please help me to run LTC2414 . i am a beginner in the case of arduino programming.
Do you think it's wise to start with Arduino programming using a chip that doesn't have library support on the Arduino platform? If you put a yes behind this, start with your project, write some code and post it here if you run into problems. This forum is not meant to be a programming service for free.
A newbie with a 16 channel 24 bit ADC. That's an interesting combination ![]()
For informed help, please post a link to the board design you are using, or if your own design, post schematics and a photo of the board.
You are, of course, aware of the LTC2418 demo board and companion Arduino board that is already available.
Hi,
Welcome to the forum.
Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html
Can you post a link to data/specs of LTC2414?
Can you tell us your electronics, programming, Arduino, hardware experience?
Thanks.. Tom... ![]()
Hi
I will put my schematic of arduino board and program i have used here.
i want to use two channels of LTC2414. but with the below code...output data is a fixed...in variable input, no changes happens in output....whats the problem?
#include <stdint.h>
#include <SPI.h>
// LTC2418 single-ended configuration bytes
// these are the binary commands converted to hex to be sent through MISO
#define LTC2418_CH0 0xB0
#define LTC2418_CH1 0xB8
#define LTC2418_CH2 0xB1
#define LTC2418_CH3 0xB9
#define LTC2418_CH4 0xB2
#define LTC2418_CH5 0xBA
#define LTC2418_CH6 0xB3
#define LTC2418_CH7 0xBB
#define LTC2418_CH8 0xB4
#define LTC2418_CH9 0xBC
#define LTC2418_CH10 0xB5
#define LTC2418_CH11 0xBD
#define LTC2418_CH12 0xB6
#define LTC2418_CH13 0xBE
#define LTC2418_CH14 0xB7
#define LTC2418_CH15 0xBF
/*macros*/
/********************************************************/
// set pin low
#define output_low(pin) digitalWrite(pin, LOW)
// set pin high
#define output_high(pin) digitalWrite(pin, HIGH)
// return the state of pin
#define input(pin) digitalRead(pin)
/********************************************************/
#define CS_multiplex 10
#define CS_accel 9
#define CS_mag 8
// constants
// constants defined within the LTC2418.h file are hex values corresponding to commands (when converted to binary) for reading each channel in single-ended mode
const uint8_t BUILD_COMMAND_SINGLE_ENDED[16] = {LTC2418_CH0, LTC2418_CH1, LTC2418_CH2, LTC2418_CH3,
LTC2418_CH4, LTC2418_CH5, LTC2418_CH6, LTC2418_CH7,
LTC2418_CH8, LTC2418_CH9, LTC2418_CH10, LTC2418_CH11,
LTC2418_CH12, LTC2418_CH13, LTC2418_CH14, LTC2418_CH15
};
const uint16_t MISO_TIMEOUT = 1000; // the MISO timeout (ms)
// function prototypes
int8_t LTC2418_EOC_timeout(uint8_t cs, uint16_t miso_timeout); // check LTC2418 to see if end of conversion
void LTC2418_single_read_raw(uint8_t cs, uint8_t adc_command, uint32_t *adc_code); // read single channel raw data
void setup() {
// set chip select pins as output pins
pinMode(CS_multiplex, OUTPUT);
pinMode(CS_accel, OUTPUT);
pinMode(CS_mag, OUTPUT);
SPI.begin();
SPI.beginTransaction(SPISettings(4000000, MSBFIRST, SPI_MODE0));
output_high(CS_multiplex); // pulls DAQ multiplexer chip select high
output_high(CS_accel); // pulls accelerometer chip select high
output_high(CS_mag); // pulls magnometer chip select high
Serial.begin(115200); // begin serial port with specified baud rate
}
void loop()
{
while (1)
{
uint32_t raw_output;
uint8_t tx_command;
tx_command = BUILD_COMMAND_SINGLE_ENDED[8]; // build ADC command
Serial.print("\nReading channel 8...\n");
if (LTC2418_EOC_timeout(CS_multiplex, MISO_TIMEOUT == 1)) // check for EOC
{
Serial.print("Wait for EOC timed out\n");
}
LTC2418_single_read_raw(CS_multiplex, tx_command, &raw_output);
Serial.print("RAW TX: ");
Serial.print(tx_command, HEX);
Serial.print("\n");
Serial.print("RAW RX: ");
Serial.print(raw_output, HEX);
Serial.print("\n");
delay(2000);
}
}
// function definitions
// Checks for EOC with a specified timeout
int8_t LTC2418_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
{
uint16_t timer_count = 0; // Timer count for MISO
output_low(cs); //! 1) Pull CS low
while (1) //! 2) Wait for SDO (MISO) to go low
{
if (input(MISO) == 0)
{
break; //! 3) If SDO is low, break loop
}
if (timer_count ++ > miso_timeout) // If timeout, return 1 (failure)
{
output_high(cs); // Pull CS high
return(1);
}
else
delay(1);
}
return(0);
}
// Reads single channel raw data on LTC2418
void LTC2418_single_read_raw(uint8_t cs, uint8_t adc_command, uint32_t *adc_code)
{
union union_int32_4bytes
{
uint32_t LT_uint32; // 32-bit unsigned integer
int32_t LT_int32; // 32-bit signed integer
uint8_t LT_byte[4]; // 4 bytes unsigned (4 * 8-bit integers)
} data, command;
command.LT_byte[0] = adc_command;
command.LT_byte[1] = 0;
command.LT_byte[2] = 0;
command.LT_byte[3] = 0;
output_low(cs); //! 1) Pull CS low
data.LT_byte[0] = SPI.transfer(command.LT_byte[0]);
data.LT_byte[1] = SPI.transfer(command.LT_byte[1]);
data.LT_byte[2] = SPI.transfer(command.LT_byte[2]);
data.LT_byte[3] = SPI.transfer(command.LT_byte[3]);
output_high(cs); //! 3) Pull CS high
Serial.print("TX:\n");
Serial.print("LT_byte[0] = "); Serial.print(command.LT_byte[0], BIN); Serial.print("\t");
Serial.print("LT_byte[1] = "); Serial.print(command.LT_byte[1], BIN); Serial.print("\t");
Serial.print("LT_byte[2] = "); Serial.print(command.LT_byte[2], BIN); Serial.print("\t");
Serial.print("LT_byte[3] = "); Serial.print(command.LT_byte[3], BIN); Serial.print("\t");
Serial.print("\n");
Serial.print("RX:\n");
Serial.print("LT_byte[0] = "); Serial.print(data.LT_byte[0], BIN); Serial.print("\t");
Serial.print("LT_byte[1] = "); Serial.print(data.LT_byte[1], BIN); Serial.print("\t");
Serial.print("LT_byte[2] = "); Serial.print(data.LT_byte[2], BIN); Serial.print("\t");
Serial.print("LT_byte[3] = "); Serial.print(data.LT_byte[3], BIN); Serial.print("\t");
Serial.print("\n");
*adc_code = data.LT_int32;
}
Hi,
The LT1021 is a voltage reference NOT a power supply regulator, it is only rated to 10mA output current.
Have you a DMM to measure the 5V supply to the UNO and 2414?
I don't think you can leave pin19 on the 2414 open circuit?
What is your 9V power supply?
Thanks.. Tom... ![]()
241418fb.pdf (871 KB)
ali_elect62:
whats the problem?
Have you studied the datasheet ?
All pins connected as described ?
hi
thanks for answers
i make some changes in circuit. you can see in attachment .but output data still is fixed.
what about my program?is it correct? ![]()
hi
whit above code the output data varies...for 5v the output is 0.0043021v....& for 3.3v is -1.545451.....& for 0v is -2.5v
above program has just one channel (ch0),now if i want to have 2 channels(ch0 & ch1) whit 0 to 16777216 output data ,what should i do?
thanks
what should I do
Stop ignoring our questions and explanations about exsisting hardware problems.
It has been pointed out that the connections to the LTC1021 are incorrect. You were asked in post #7 to measure voltages that would confirm this.
You continue to ignore these facts and questions.
To be absolutely clear: the output of the LTC1021 is connected to one point only, the REF input of the ADC. The LTC2414 VCC pin should be connected to the 5 volt output of the Uno.
Hello
Sorry i can not write english well.maybe it makes some misconceive.
You can see in schematic that i use separatly 9 VDC power suply for the LT1021 input.
I did what you said" the output of the LT1021 is connected to one point only."
Now i want to activate CH0 & CH1, in whitch 0 to 16777216 output became available, then i can check this new changes in the circuit with results.
Hi,
Have you wired the 5V to the 2414 like this?
Have you got any thing connected to the 2414 ch0 ns ch1?
I would suggest you use two potentiometers so you can control the ch0 and ch1 inputs.
Tom.. ![]()
Have you wired the 5V to the 2414 like this?
Yes
Have you got any thing connected to the 2414 ch0 ns ch1?
Tow potentiometeres 10k ohm are conected to ch 0 and ch1.
But above code read just one channel(ch0).
What should i do , to read tow channels?
Hi,
Have you got just one channel working and reading accurate input voltages?
If you put ;
0V input what do you get RAW from the 2414?
1V input what do you get RAW from the 2414?
2V input what do you get RAW from the 2414?
3V input what do you get RAW from the 2414?
4V input what do you get RAW from the 2414?
5V input what do you get RAW from the 2414?
Thanks.. Tom.. ![]()
Have you got just one channel working and reading accurate input voltages?
If you put ;
0V input what do you get RAW from the 2414?
1V input what do you get RAW from the 2414?
2V input what do you get RAW from the 2414?
3V input what do you get RAW from the 2414?
4V input what do you get RAW from the 2414?
5V input what do you get RAW from the 2414?
For 0v
RAW TX: B4
RAW RX: 1503D8A1
VOLTAGE: -1.716403V
For 1v
RAW TX: B4
RAW RX: 19681DA0
VOLTAGE: -1.030203V
For 2v
RAW TX: B4
RAW RX: 1DBFCDA0
VOLTAGE: -0.351683V
For 3v
RAW TX: B4
RAW RX: 22181721
VOLTAGE: 0.327203V
For 4v
RAW TX: B4
RAW RX: 2654DFE0
VOLTAGE: 0.989303V
For 5v
RAW TX: B4
RAW RX: 2ABBE761
VOLTAGE: 1.677187V
Appears to be working but with offset.
What DC voltage do you measure between pins 11 and 12 of the LTC2414 (REF+ and REF-) ?
Hi
What DC voltage do you measure between pins 11 and 12 of the LTC2414 (REF+ and REF-) ?
Its 5V
I think there are some problems in the code....!
![]()



