From: Spehro Pefhany
Subject: Re: help! spi code example written in C language needed!
References: <3e056b89@shknews01> <firstname.lastname@example.org>
X-Newsreader: Forte Agent 1.92/32.572
Date: Mon, 23 Dec 2002 00:45:26 GMT
NNTP-Posting-Date: Sun, 22 Dec 2002 19:45:26 EST
On 22 Dec 2002 16:25:58 -0800, the renowned email@example.com (Harry
>"lijin" wrote in message news:<3e056b89@shknews01>...
>> hi,for a quick start,i need some code example
>> of bi-direction spi interface communication
>> (typically, the communication code for a 8051
>> mcu which has built-in spi interface support
>> and a memory which also supports spi protocol)
>> implemented in C language.
>This comes as a surprise to some of us 8051 programmers.
>Hell, I've been programming 8051s and 80C320s for years without ever
>hearing the term "spi".
>Is this some variation on a sstandary async RS-232 port, or just what?
No, it's a very simple synchronous serial communication method
originated by Motorola. Essentially just an 8-bit shift register in
the slave and in the master; the master generates a clock signal which
clocks the data out of the master and into the slave, and vice-versa.
Framing is done by separate /CE lines to each device on the bus.
Similar to National's Microwire interface, and sometimes used in
place of I^2C where it has some advantage (such as speed).
"it's the network..." "The Journey is the reward"
firstname.lastname@example.org Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog Info for designers: http://www.speff.com