Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

Looking for information and codes on SPI interfacing

Status
Not open for further replies.

pepillo

Advanced Member level 4
Joined
Jan 23, 2006
Messages
114
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
Spain
Activity points
2,382
SPI interface

Need information & code examples using SPI bus to drive any dsp/mcu/eeprom.
Thanks in advance
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,497
Re: SPI interface

This is a very good explanation regarding SPI interface (including mode 0 -3)
It's specific for AVR microcontrollers but you can learn a lot.

http://avrhelp.mcselec.com/Using_the_SPI_protocol.html

For code you must be more concise. As you read above the interconnection between two SPI devices always happens between a master device and a slave device. Which one you would like to be ? You mentioned "dsp/mcu/eeprom"

If 25LC640 is your concern then a briefly look into datasheet will give you some information about a slave:
http://ww1.microchip.com/downloads/en/devicedoc/21223g.pdf

Then you can look into two applications for the master behaviour:

One microcontroller with SPI by default

http://ww1.microchip.com/downloads/en/appnotes/00966a.pdf

and one where four GPIO are used for SPI

http://ww1.microchip.com/downloads/en/appnotes/01006a.pdf

Both of them using slave 25XXX SPI EEPROM series with nice snap shoots on logic analyzer screen.

The Microchip's funs on the forum will point out a better explanation for SPI.
Just because the SPI interface was established by Microchip, thus the best explanation of the interface must come from them.
 

    pepillo

    points: 2
    Helpful Answer Positive Rating

pepillo

Advanced Member level 4
Joined
Jan 23, 2006
Messages
114
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
Spain
Activity points
2,382
Re: SPI interface

Thx a lot, silvio, great links that i will dive in soon. Hope to see ya around here often.
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,497
Re: SPI interface

pvinbox(at)yahoo.com said:
hai

pls check microchip application notes
there is lot of application notes are there.

bye
Smart answer.

If you're a really Microchip fun can you post a link from Microchip web site where it's clearly explained the ISP interface, but not specific to a device. It must be general reference. And definitely a link not kick and run.

BTW we are here to help each other and not earning or accumulating points.
You can even gain some friends.
But not with such kind of answers.

there is lot of application notes are there.
You know I've just pass through my favorite supermarket. And guess what ?
They just got in stock my lovely microcontroller.

Look at kachuisa's advice too. He just pass through my favorite supermarket, too
Oh, yeah I've just been there, I look around for a while, but I've forgot the shelf with your application note. Yeah, you better take a look too. And do not mind if you don't find it. And tomorrow is a day.
 

    pepillo

    points: 2
    Helpful Answer Positive Rating

Jos Brink

Member level 3
Joined
Jan 28, 2004
Messages
64
Helped
9
Reputation
18
Reaction score
2
Trophy points
1,288
Activity points
577
Re: SPI interface

First of all a huge laugh.. thnx silvio!!! :D

ok back on topic.

heheh still laughin.

SPI is a trademark of Motorola so if you are looking for the protocol description visit them.
What kind of controller are you using?

I think that SPI is the most easiest protocol there is.. much easier than i²c, 1Wire, CAN, or even standard serial data from any uart. the only pitfall is the idle state. and the phase of the clock signal, every chip has its own.
oh, i had some problems with spi, some chips are using the CS line to initiate a spi cycle. Read your datasheets and you'll find out.

for any questions.. please come again.
 

    pepillo

    points: 2
    Helpful Answer Positive Rating

pepillo

Advanced Member level 4
Joined
Jan 23, 2006
Messages
114
Helped
3
Reputation
6
Reaction score
0
Trophy points
1,296
Location
Spain
Activity points
2,382
Re: SPI interface

i'm using 25lc640 to send a boot image to a dsp (VS1011 mp3 codec). i haven't got any controller, just the 25lc640 programmed with the boot image, the codec, and one mmc card with spi interface. i think the dsp requests the boot image on reset and then it works standalone. but anyway i need to understand the spi interface to achieve functionality.
 

silvio

Advanced Member level 3
Joined
Dec 31, 2001
Messages
716
Helped
105
Reputation
210
Reaction score
16
Trophy points
1,298
Location
Romania
Activity points
11,497
Re: SPI interface

Jos Brink said:
SPI is a trademark of Motorola so if you are looking for the protocol description visit them.
YES it's correct. My apologize for misleaded information. I don't know why I ever thought to Microchip as the developer of SPI bus.

P.S. I like AVR too and I'm joining to your opinion regarding PIC.
 

    pepillo

    points: 2
    Helpful Answer Positive Rating

rabin2801

Member level 4
Joined
Dec 28, 2010
Messages
71
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Activity points
1,862
Re: SPI interface

i want use VS1011 mp3 codec & SD card on same SPi...
is this possible????????????/
link>>>>>>>>>???
 

eldhose555

Junior Member level 1
Joined
Jul 30, 2009
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
india
Activity points
1,347
Re: SPI interface

both those devices will have a chip select or device select pin. by controlling the logic state on that pin, u can connect them on same SPI.. u should disable one device while communicating with other..
 
Last edited:

rabin2801

Member level 4
Joined
Dec 28, 2010
Messages
71
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,288
Activity points
1,862
Re: SPI interface

but many people says about loading problem???
what about this??
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top