<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>LeafLabs Garden &#187; Topic: How to clear SPI TX buffer?</title>
		<link>http://forums.leaflabs.com/topic.php?id=1250</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:26:09 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=1250" rel="self" type="application/rss+xml" />

		<item>
			<title>mbolivar on "How to clear SPI TX buffer?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1250#post-7568</link>
			<pubDate>Wed, 11 Jan 2012 12:40:22 +0000</pubDate>
			<dc:creator>mbolivar</dc:creator>
			<guid isPermaLink="false">7568@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I've never needed to do this, so I don't know for sure. Have you tried turning the peripheral off and on?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ihkim on "How to clear SPI TX buffer?"</title>
			<link>http://forums.leaflabs.com/topic.php?id=1250#post-7477</link>
			<pubDate>Sun, 01 Jan 2012 11:00:15 +0000</pubDate>
			<dc:creator>ihkim</dc:creator>
			<guid isPermaLink="false">7477@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;I am using Maple r5 board.&#60;/p&#62;
&#60;p&#62;I set the board as SPI Slave and uses DMA to receive and send data.&#60;br /&#62;
Most of time Command comes from Master and Slave responses.&#60;/p&#62;
&#60;p&#62;So I made code to wait for receiving Command from Master. Once Command is received, send response back to Master. This approach is working.&#60;/p&#62;
&#60;p&#62;But, really trouble, rarely, Slave needs to send data itself.&#60;/p&#62;
&#60;p&#62;In that case, I disable DMA RX, TX buffer and canceled waiting Command.&#60;br /&#62;
After that, SPI is reinitiated with DMA RX, and TX buffer with new data to be sent to Mater.&#60;/p&#62;
&#60;p&#62;When I took a look the signal, the first byte to be sent to Master is always from dummy value from previous waiting Command transaction.&#60;/p&#62;
&#60;p&#62;Even I canceled waiting Command transaction, 1 byte still remains in TX buffer.&#60;br /&#62;
I tried to find a way how to clear TX buffer in STM32F103 reference manual, I couldn't find it.&#60;/p&#62;
&#60;p&#62;Anybody has any idea how to clear TX buffer?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
