Dear TI Employee & members,
I am currently working on a project to interface ADS1258EVM board to Arduino Mega2560 via SPI interface (SCLK, MISO,MOSI,CS).
I have tested the ADS1258EVM board with MMBO DSP kit and it works fine.
Now I have removed the ADS1258EVM board from MMB0 and connected it to the Ardunio MEGA2560.
Jumper settings are as follows:
1) J5.3 (+5VA) connected to +5V of Arduino.
2) J5.5 (DGND) and J5.6 (AGND) to GND.
3) J5.9 to +3.3V.
The jumper settings for J4 are accroding to the figure 3 of Users guide.Aditionally I have measured the currents on the jumper and they seem fine.
Next,
4) J6.1 (Start ) and J6.2 (PWDN) connected to 5V(High)
5) J6.3 (SCLK) connected to Pin50 of arduino.
6) J6.7 (CS) to pin53 chip select.
7) J6.11 (DIN) to pin51 (MOSI).
8) J6.13 (DOUT) to pin50 (MISO)
9) J6.15 (DRDY) to pin2 (interupt).
On J1 and J2 I have connected 16 analog channels of my sensor.
I am using external clock at 16MHz for SPI clock SCLK.I have programmed the SCLK in code and I am dividing it by 128. So 16MHz/128= 125KHz. Is its fine?Lower limit on clock is I have calculated is 73.5KHz with DRATE=00 (1/1831=546µs, and tsclk=546µs/40=13.6µs >> Freq=73.5KHz)
The ADS1258 is using its own internal clock at 15.78 MHz. CLKSL pin is attached to GND.
The register settings are:
CONFIG0=0x02 ( STAT=1, Bypass=0 internal, Mode=AutoScan)
CONFIG1=0x30 ( DLY=011, DRATE=00 i.e. 1830sps with delay it would be 1730sps)
MUXSXH=0x00
MUXDIF=0x00
MUXSG0=0xFF (All channels selected)
MUXSG1=0xFF
SYSRED=0x00
GPIOC=0xFF
GPIOD=0x00
I am usng Channel Data Read format with DRDY indication. In my program I first intialize the pins used for SPI communication and set the frequency (125KHz) and mode3 (Cphase=1, Cpolarity=1) . I have chceked all the combination of phase and polarity, this seemed to me fine as for others I donot see any actvity on the oscillopse. Also I have tried SCLK of 8MHz, 4MHz,1MHz etc and it doesnot make any affect on the output data.
Next I write all of the registers with value above and then try to read ID regsiter. The ID register is giving wrong value. Don't know why? It keeps on taking random value everytime I call it.I am using register data Read command=0B0100 0000 with MUL=0.
Secondly I read Channel data with 0B0011 0000 command for data read, MUL=1. The channel data gives me all the time 0. it seems data channel data read command acts like reset command (0B1100 0000) so it reset the register instead of reading it and give me all the time zero.
On DRDY line doesnot go LOW, it is always giving high. While I am polling for a low value indicating the new data has arrived.
On output line on oscilloscope I get zero. While I have set chip select to low , and start to high all the time.
I would be highly thankful if someone could help me figure out this problem.
Best Regards,
Faisal