<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/30491/tiny-problem-in-lpc11c24-and-ssp-port</link><description> 
I know, this is not Keil related (well sort of, I use the tools :)
but I know there are a lot of people here with a lot of
knowledge! 

 
Device is a LPC11C24 which is connected to a SD card using SSP1
(CS is done &amp;quot;manually&amp;quot;, not using SSEL functionality</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/thread/137056?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2013 18:04:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4f3cd8a0-7f15-4c26-a097-59717eefecf7</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;pre&gt;
while ( (LPC_SSP1-&amp;gt;SR &amp;amp; (SSP_SR_BSY_BUSY|SSP_SR_RNE_NOTEMPTY)) != SSP_SR_RNE_NOTEMPTY );
&lt;/pre&gt;

&lt;p&gt;
Maybe try:&lt;/p&gt;

&lt;pre&gt;
while ( LPC_SSP1-&amp;gt;SR &amp;amp; SSP_SR_BSY_BUSY )
{
    /* Do some check. */
}
while ( ! ( LPC_SSP1-&amp;gt;SR &amp;amp; SSP_SR_RNE_NOTEMPTY ) )
{
    /* Do some check. */
}
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/thread/128359?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2013 17:45:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d15ac279-0353-4a32-b848-cf0f706824f1</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
My guess:&lt;/p&gt;

&lt;p&gt;
1. You sspSend() n Bytes.&lt;br /&gt;
2. You sspReceive() m Bytes.&lt;br /&gt;
3. When you are doing&lt;/p&gt;

&lt;pre&gt;
void sspReceive(uint8_t *buf, uint32_t length)
{
    LPC_SSP1-&amp;gt;DR = 0xFF;
&lt;/pre&gt;

&lt;p&gt;
FIFO is still full. So you can only receive (m-k) Bytes.&lt;br /&gt;
4. When you are doing&lt;/p&gt;

&lt;pre&gt;
while ( (LPC_SSP1-&amp;gt;SR &amp;amp; (SSP_SR_BSY_BUSY|SSP_SR_RNE_NOTEMPTY)) != SSP_SR_RNE_NOTEMPTY );
&lt;/pre&gt;

&lt;p&gt;
SSP is not busy, but FIFO keeps empty.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/thread/117413?ContentTypeID=1</link><pubDate>Wed, 13 Nov 2013 04:05:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:5fedb7f8-2a0e-4dfb-910f-ea5d3264921b</guid><dc:creator>Carsten Groen</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks John,&lt;br /&gt;
I know what the code does in both cases.&lt;br /&gt;
What puzzles me is why the original code (that also comes with all
the samples etc) will stop working at some point. If I only check the
BUSY bit will it continue to work.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/thread/107364?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2013 18:03:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1a7fd764-4515-407a-808a-e20fd6258118</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
while ( (LPC_SSP1-&amp;gt;SR &amp;amp;
(SSP_SR_BSY_BUSY|SSP_SR_RNE_NOTEMPTY)) != SSP_SR_RNE_NOTEMPTY );&lt;br /&gt;
means you want anything but RNE to be cleared.&lt;/p&gt;

&lt;p&gt;
----------------------------------------------&amp;gt; My mistake.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/thread/92391?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2013 17:53:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c65a5651-3dac-4d5a-ba66-c99f21e0093a</guid><dc:creator>John Linq</dc:creator><description>&lt;p&gt;&lt;p&gt;
while ( (LPC_SSP1-&amp;gt;SR &amp;amp;
(SSP_SR_BSY_BUSY|SSP_SR_RNE_NOTEMPTY)) != SSP_SR_RNE_NOTEMPTY );&lt;br /&gt;
means you want anything but RNE to be cleared.&lt;/p&gt;

&lt;p&gt;
while ((LPC_SSP1-&amp;gt;SR &amp;amp; SSP_SR_BSY_BUSY));&lt;br /&gt;
means you want only BUSY to be cleared.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Tiny problem in LPC11C24 and SSP port</title><link>https://community.arm.com/thread/62379?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2013 03:14:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b4f2555f-aeba-4689-bd9d-f9d73c8254ce</guid><dc:creator>Carsten Groen</dc:creator><description>&lt;p&gt;&lt;p&gt;
No one seeing the same/having any ideas of what could be wrong
?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>