Page 1 of 1

TI ADS1298 via EB013 over SPI

Posted: Tue Sep 21, 2010 6:35 am
by mb02155
Hello,

I am trying to interface with the TI ADS1298 using the EB013 and am having some trouble. I am starting with the basics by attempting to read the ID Control register (as defined on page 42 of the datasheet http://focus.ti.com/lit/ds/symlink/ads1298.pdf). I am not getting anything back from the device. Here is what I am doing in my flowchart:

1) SPI_Init
2) Create Variable "bytetosend" and assign it to be 32 (0010 0000 binary - read register 0) First opcde - Page 40 of the datasheet
2) delay 10ms
3) SPI_SEND_CHAR bytetosend
4) delay 10ms
5) bytetosend=0 (0000 0000 binary - to read 1 register location) Second opcode - page 40 of the datasheet
6) SPI_SEND_CHAR bytetosend
7) Create variable "bytereceived"
8) SP_Get_Char bytereceived
9) delay 10ms
10) LCD_DISPLAY Start
11) delay 10ms
12) LCD_DISPLAY_PrintNumber bytereceived (expected output should be 2, but we don't get anything)

I have tried removing the delays and making them longer and still don't get anything back.

What am I doing wrong? Am I not doing something correctly with the SPI component?

Thank you!
Marty

Re: TI ADS1298 via EB013 over SPI

Posted: Tue Sep 21, 2010 12:30 pm
by Dan81
Hello Marty

where do you manage the CS (chip select) ?

Daniel

Re: TI ADS1298 via EB013 over SPI

Posted: Tue Sep 21, 2010 1:45 pm
by mb02155
At the moment /CS is tied low.

Marty

Re: TI ADS1298 via EB013 over SPI

Posted: Wed Sep 22, 2010 10:11 am
by Benj
Hello Marty,

This may be bad news to you but a lot of SPI devices actually need the CS line to begin high and then be pulled low to activate a kind of wake up interrupt. The flip side is that some SPI devices need the CS line to go back high to then process the received command. Therefore I would dig out the old soldering iron and attach the CS line to an I/O pin.

Re: TI ADS1298 via EB013 over SPI

Posted: Wed Sep 22, 2010 1:47 pm
by mb02155
Thanks for the reply.

I will reattach it to an i/o pin and try again. I will let you know if that makes a difference.


Marty

Re: TI ADS1298 via EB013 over SPI

Posted: Mon Oct 18, 2010 4:35 am
by mb02155
Hello,

I am still stuck on this. I have the following connections between the ADS1298 and the PIC:

ADS1298 SCLK -> 18F4550 Pin 34 (SCLK)
ADS1298 SDI -> 18F4550 Pin 26 (SDO)
ADS1298 SDO -> 18F4550 Pin 33 (SDI)
ADS1298 /CS -> 18F4550 Pin 8 (RE0)
ADS1298 SPI Start -> 18F4550 Pin 9 (RE1)
ADS1298 Reset -> Pin 10 (RE2)
ADS1298 SPI DRDY -> Pin 35 (Int2)

I have attached the flowchart that I am using. Anyone got any suggestions on what I am doing wrong?

Thank you very much!!
Marty

Re: TI ADS1298 via EB013 over SPI

Posted: Fri Nov 12, 2010 6:24 am
by mb02155
I am still stuck on making this work. I believe that things are working to read data via SPI, but I don't think it is sending characters. Is it possible I should use something other than the SPI_Legacy? What about SPI_SEND_CHAR - would that be correct? I have tried sending characters and bytes and nothing seems to work.

Any suggestions?

Re: TI ADS1298 via EB013 over SPI

Posted: Fri Nov 12, 2010 1:36 pm
by Dan81
Hello Marty

Try the attached file, I've modified the "ADS1298Init" macro.
I'm not sure of my work, ADS1298 is a big component with lot of configuration.

Can you take a look on the SPI signals with an oscilloscope or a logic analyser ?

Good luck

Daniel

Re: TI ADS1298 via EB013 over SPI

Posted: Fri Nov 12, 2010 1:42 pm
by Spanish_dude
Hi,
5) bytetosend=0 (0000 0000 binary - to read 1 register location) Second opcode - page 40 of the datasheet
OPCODE 2 seems to be 01h (0000 0001b) and not 00h.

Regards,

Nicolas Lopez F.