SPI communication needed!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

SPI communication needed!

Post by 407charles »

I'm having a problem communicating with the ADC 3208 IC. It's SPI protocol 12 Bit ADC. Here is my program and chip datasheet. I don't know what I'm doing wrong. I will appreciate any help or advice.
Attachments
Frequency ADC.fcfx
program
(7.96 KiB) Downloaded 233 times
ADC 3208.pdf
datasheet
(529.33 KiB) Downloaded 232 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: SPI communication needed!

Post by Benj »

Hello,

This blog post on SPI comms may help to get you started.

http://www.matrixtsl.com/blog/simplifie ... c-and-spi/

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: SPI communication needed!

Post by 407charles »

Hi Benj, thanks for your help. I did a temperature controller project and you help me with it before, but the SPI program was different. The program for the controller only included to read data from the MAX6675. For what I see on the SPI blog, the read write commands should be done separately, the chip command should be in LOW state and then the write or read command should be sent out and finish the read or write task with chip disable by energizing the CS pin. Is that right?
My problem is that I'm not understanding the timing graph on the datasheet. It says that write has to be done in the rising edge and after the sixth clock pulse the output data is delivered in a twelve bit format with the MSB first. Down in the data sheet in section 6, it shows how to work with eight bit groups to interface with different microcontrollers but the output data in delivered in the falling edge of the clock and I getting confuse with the right settings for the SPI component. Do I need to use two? one set it up for rising edge and another for the falling edge? another question is, I will be able to read the data at that particular timing? Please, give a hand if you can. I appreciate your time and help. Thanks a lot.

kersing
Valued Contributor
Valued Contributor
Posts: 2045
Joined: Wed Aug 27, 2008 10:31 pm
Location: Netherlands
Has thanked: 553 times
Been thanked: 1081 times
Contact:

Re: SPI communication needed!

Post by kersing »

“Integrity is doing the right thing, even when no one is watching.”

― C.S. Lewis

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: SPI communication needed!

Post by 407charles »

I got the program for the MAX6675 working. It was more simple than communicating with the ADC3208. In this case the writing command are needed to set the chip, also, the write data command needed being done at the rising edge and reading in the falling edge of the clock respectively. I tried different ideas but without results. I don't know if my SPI component settings are right. I going to keep trying but I'm running out of ideas. I appreciate your response and your help. Thanks a lot.

407charles
Posts: 122
Joined: Thu Jun 26, 2014 12:01 pm
Has thanked: 41 times
Been thanked: 19 times
Contact:

Re: SPI communication needed!

Post by 407charles »

I tried several modifications in my program but not able to achieve anything. I guess I should try another ADC.

Post Reply