Need help SPI component.

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
dinhchithanh
Posts: 12
Joined: Wed Oct 01, 2008 5:49 pm
Location: Da Nang University of Technology-VietNam
Contact:

Need help SPI component.

Post by dinhchithanh »

I can write data but not read data with SPI interface. Matrixmutilmedia's supporter can help me an example SPI interface ???
Thank in advanced

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: Need help SPI component.

Post by Benj »

Hello,

Sure we can help. Here are a few quick questions to get started.

What are you interfacing to via SPI?

How do you know writes are working ok?

Do you have a demo program you are using that I could look at? (you can attach Flowcode programs to the forum if you need to)

dinhchithanh
Posts: 12
Joined: Wed Oct 01, 2008 5:49 pm
Location: Da Nang University of Technology-VietNam
Contact:

Re: Need help SPI component.

Post by dinhchithanh »

Ok Benj.
I uses TC72 to measurement temperature. When power on, TC72's configure register is 05h. Then i write cnfigure word 04h to TC72 active. I uses Proteus VSM to simulation circuit. So i know i can write data to TC72 but i can't read temprature. please see picture attacth
Image
Thank in advanced

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: Need help SPI component.

Post by Benj »

Hello

Are you toggling the CS enable line as shown in page 5 of the datasheet.

http://ww1.microchip.com/downloads/en/D ... 21743a.pdf

Basically send the CS line high then perform the read and when you are finished send the CS line low again.

dinhchithanh
Posts: 12
Joined: Wed Oct 01, 2008 5:49 pm
Location: Da Nang University of Technology-VietNam
Contact:

Re: Need help SPI component.

Post by dinhchithanh »

Ever have an example I2C EEprom on MM website
http://www.matrixmultimedia.com/Downloa ... .php?id=39

and then i do I2c very well. I sucessfuly to read time from DS1307 RTC with I2C protocol

Image

I think MM'supporters have an example about SPI component. I will learn in these example.

Thanks
Thank in advanced

Post Reply