<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
	<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
	<TITLE>SPI</TITLE>
	<META NAME="GENERATOR" CONTENT="OpenOffice.org 1.0.1  (Win32)">
	<META NAME="CREATED" CONTENT="20040512;8444979">
	<META NAME="CHANGED" CONTENT="20040512;17233665">
</HEAD>
<BODY LANG="fr-FR">
<P STYLE="margin-bottom: 0cm"><FONT SIZE=2><FONT FACE="Helvetica, Arial, sans-serif"><A HREF="javascript:history.go(-1)"><IMG SRC="../images/back.gif" NAME="Image1" ALT="Back" ALIGN=MIDDLE HSPACE=5 WIDTH=37 HEIGHT=44 BORDER=0></A><A HREF="javascript:history.go(-1)">
</A>
<A HREF="../summary.html"><IMG SRC="../images/sommaire.gif" NAME="Image2" ALT="Summary" ALIGN=MIDDLE HSPACE=5 WIDTH=37 HEIGHT=44 BORDER=0></A><A HREF="../summary.html">
</A><BR><IMG SRC="../images/entete.gif" NAME="Image3" ALIGN=BOTTOM WIDTH=541 HEIGHT=13 BORDER=0>
</FONT></FONT>
</P>
<P ALIGN=CENTER STYLE="margin-bottom: 0cm"><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><B>SPI</B></FONT></FONT></P>
<P STYLE="margin-left: 2cm"><BR><BR>
</P>
<P STYLE="margin-left: 2cm"><FONT COLOR="#000000"><FONT FACE="Arial, sans-serif"><FONT SIZE=2>The
Serial Peripheral Interface (SPI) allows full duplex, synchronous,
serial communication with external devices. <BR>An SPI system may
consist of a master and one or more slaves however the SPI interface
can not be a master in a multi-master system.</FONT></FONT></FONT></P>
<P ALIGN=LEFT STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_conf_and_use.gif" NAME="Image4" ALT="SPI, Configure and Use" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>Check
				this option to enable the configuration of the SPI. Checking this
				option will make visible the other options. </FONT></FONT>
				</P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_en_output.gif" NAME="Image5" ALT="SPI, Enable Output" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>Enable
				the Serial Peripheral output. This option enables the alternate
				functions of SPI pins. If you keep it unchecked, the SPI will NOT
				work until you manually change the configuration of the IOs.</FONT></FONT></P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_clock_div.gif" NAME="Image6" ALT="SPI, Clock Divider" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>The
				f<FONT SIZE=1>cpu<FONT SIZE=2> is divided by this prescaler in
				order to obtain the SPI clock rate</FONT></FONT>. Values can be
				4, 8, 16, 32, 64 or 128. The clock is driven by the master, and
				the divider does NOT impact on the baud rate when the SLAVE mode
				is selected.</FONT></FONT></P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_clock_phase.gif" NAME="Image7" ALT="SPI, Clock Phase" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>If
				checked, this option sets the second clock transition to be the
				first capture edge. If not checked, the first clock transition is
				the first data capture edge.<BR>This option, and the clock
				polarity, define the handling of the byte-frame. These options
				MUST be the same for both the master and the slaves.</FONT></FONT></P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_clock_polarity.gif" NAME="Image8" ALT="SPI, Clock Polarity" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>If
				checked, the SCK pin has a high level idle state. If not checked,
				SCK pin has a low level idle state. This option, and the clock
				phase, define the handling of the byte-frame. These options MUST
				be the same for both the master and the slaves </FONT></FONT>
				</P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_master_mode.gif" NAME="Image9" ALT="SPI, Master Mode" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>Check
				this option to enable the MASTER mode. Uncheck it if your device
				has to be considered as a slave in the SPI communication.</FONT></FONT></P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_soft_sel_slave.gif" NAME="Image10" ALT="SPI, Software selected Slave" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>In a
				multi-slave mode, the master select a specific slave by pulling
				down its /SS pin that acts as a chip select. As an alternative to
				using this /SS pin to control the Slave Select signal, you can
				choose to manage the Slave Select signal by software. If you
				check this option, the selection will be done by software and the
				/SS pin could be used for any other purpose. </FONT></FONT>
				</P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_recp_pol_mode.gif" NAME="Image11" ALT="SPI, Use Reception Polling Mode" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>SPI
				reception can be handled either by interrupt or polling. Check
				this option to select the polling mode, uncheck it if you prefer
				the interrupt mode. </FONT></FONT>
				</P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_trans_pol_mode.gif" NAME="Image12" ALT="SPI, Use Transmission Polling Mode" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2>SPI
				transmission can be hndled either by interrupt or polling. Check
				this option to select the polling mode, uncheck it if you prefer
				the interrupt mode. .<BR><FONT COLOR="#009900"><BR>Note: it is
				not possible to select the &laquo;&nbsp;interrupt mode&nbsp;&raquo;
				for both transmission and reception.</FONT></FONT></FONT></P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P STYLE="margin-bottom: 0cm"><BR>
</P>
<CENTER>
	<TABLE WIDTH=90% BORDER=0 CELLPADDING=0 CELLSPACING=0>
		<TR>
			<TD WIDTH=30 VALIGN=TOP>
				<P><FONT FACE="Helvetica, Arial, sans-serif"><FONT SIZE=2><IMG SRC="../images/SPI_gen_sample_code.gif" NAME="Image13" ALT="SPI, Generate Sample Code" ALIGN=BOTTOM WIDTH=225 HEIGHT=20 BORDER=0>
				</FONT></FONT>
				</P>
			</TD>
		</TR>
		<TR>
			<TD VALIGN=TOP>
				<P><FONT SIZE=2><FONT FACE="Helvetica, Arial, sans-serif">Check
				this option if you want <I>RBuilder</I> to generate an example of
				source code using the SPI. The code will be inserted in the main
				function. This is useful to see how to use the <I>ST7 library</I>
				functions</FONT></FONT>.</P>
			</TD>
		</TR>
	</TABLE>
</CENTER>
<P><FONT SIZE=2><FONT FACE="Helvetica, Arial, sans-serif"><BR><BR><BR><IMG SRC="../images/pieddepage.gif" NAME="Image14" ALIGN=BOTTOM WIDTH=541 HEIGHT=39 BORDER=0>
<BR><BR><BR><BR><BR><BR><BR></FONT></FONT><BR><BR><BR><BR><BR>
</P>
</BODY>
</HTML>