Page 1 of 1

Need help SPI component.

Posted: Thu Feb 05, 2009 11:43 am
by dinhchithanh
I can write data but not read data with SPI interface. Matrixmutilmedia's supporter can help me an example SPI interface ???

Re: Need help SPI component.

Posted: Thu Feb 05, 2009 2:24 pm
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)

Re: Need help SPI component.

Posted: Sat Feb 07, 2009 2:16 am
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

Re: Need help SPI component.

Posted: Mon Feb 09, 2009 3:10 pm
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.

Re: Need help SPI component.

Posted: Wed Feb 11, 2009 3:38 pm
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