<?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>MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24929/mcb2300-spi-serial-flash-issue</link><description> 
Hello, 

 
I&amp;#39;m trying to use the MCB2300 board (LPC2378) with an external
serial flash using SPI (ST M25P80). 
First, I used SPI without interrupt and it works without any problem.
But LPC2378 SPI has a maximum clock of 9MHz (with a 72MHz master
clock</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/125176?ContentTypeID=1</link><pubDate>Fri, 27 Feb 2009 03:12:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b90ed0f5-b0b6-440c-92cd-8a0be8ab3684</guid><dc:creator>Garfay Liu</dc:creator><description>&lt;p&gt;&lt;p&gt;
Would you mind sharing your advice?&lt;/p&gt;

&lt;p&gt;
I would like to know the correct way of handling S0SPSR and
S0SPDR.&lt;/p&gt;

&lt;p&gt;
Thanks, Garfay.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/114587?ContentTypeID=1</link><pubDate>Sun, 18 Jan 2009 23:39:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:3fa31aaa-644b-4db6-99e0-bc73b93ba367</guid><dc:creator>Aur&amp;#195;&amp;#169;lien MICHELVIOUX</dc:creator><description>&lt;p&gt;&lt;p&gt;
You&amp;#39;re welcome !&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/101544?ContentTypeID=1</link><pubDate>Fri, 16 Jan 2009 04:59:51 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:88ffdd78-bc1c-420a-a907-8fed961fd9f6</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Dear Aurelien&lt;br /&gt;
&lt;b&gt;Thank you very much. for your valuable help&lt;/b&gt;&lt;br /&gt;
my SPI communication is working.from your code i got lot of help.&lt;br /&gt;
be in touch.....&lt;/p&gt;

&lt;p&gt;
regards&lt;br /&gt;
Shyam T.&lt;br /&gt;
Pune India.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/114579?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2009 03:48:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:41ea69d6-01e7-4948-ad26-3bac6f707f61</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;Got your coad&lt;br /&gt;
Thank a lot.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
confusing the perpetrator and the victim?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/101542?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2009 03:15:21 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cc7d4202-de0b-4ae6-9031-58d15afd4453</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Got your coad&lt;br /&gt;
Thank a lot.&lt;/p&gt;

&lt;p&gt;
Regards&lt;/p&gt;

&lt;p&gt;
Shyam.T&lt;br /&gt;
Pune India&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/101545?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2009 23:15:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f618538a-3449-4b87-b80d-62d33070c069</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Dear Aurelen&lt;/p&gt;

&lt;p&gt;
I not getting your mail.&lt;br /&gt;
will u send me again?&lt;br /&gt;
My mail ID is&lt;br /&gt;
&lt;b&gt;shyam_tayade@rediffmail.com&lt;br /&gt;
or u can send me&lt;br /&gt;
ganeshbadgujar99@yahoo.co.in&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
regards&lt;br /&gt;
Shyam T.&lt;br /&gt;
pune India&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/101543?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2009 03:58:16 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f5f28a1e-c30a-4c5e-bd3c-e831d4a47a7f</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;b&gt;Thanks a lot sir&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
regards&lt;br /&gt;
Shyam T.&lt;br /&gt;
Pune India.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/77053?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2009 03:26:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:c1911efb-55ff-4682-9a8f-d97db437f35b</guid><dc:creator>Aur&amp;#195;&amp;#169;lien MICHELVIOUX</dc:creator><description>&lt;p&gt;&lt;p&gt;
I&amp;#39;ve send you my SPI code.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/53265?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2009 03:12:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6c580e2d-5ef1-446f-ad2d-269d79b950b7</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Dear Aurelien&lt;br /&gt;
Sorry,here I am not giving you solution on ur problems.&lt;br /&gt;
but u can help me on my SPI communication &lt;b&gt;LPC2378 with dataflash
(AT456DB161)&amp;lt;/&amp;gt;b.Here I am in trouble from few days.I am not
getting data on S0SPDR after simulation.&lt;br /&gt;
Here is my SPI master initalization&lt;br /&gt;&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
&lt;b&gt;void InitSPI(void)
{

                PCONP   |= 0x100;
                PINSEL0  |= 0xC0000000;                 //P0.15    spi pin configuration
                PINSEL1 |= 0x0000003F;          //P0.16,P0.17,P0.18

                PCLKSEL0 |= 0x00000000;                 //PCLK= CCLK/4



                IODIR0          = SPI0_SEL;
                IOSET0  |= 0x4000;
                IODIR0          = 0x4000;
                IOSET0  |= 0x800;

                S0SPCCR  |= 0xA5;
                //S0SPCCR        |= 0xA8;                          // spi bus frequency


                S0SPCR  |= 0x20;                                //CPH = 0, CPOL = 0

&lt;/b&gt;
&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;Here I am writing on SPI (S0SPDR register)&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;
void WrToflash(unsigned int BaseAdd,unsigned char size,unsigned char *buffAdd1)
{
        unsigned char k;
        unsigned char u32dummyData;
        for (k=0;k&amp;lt;size; k++)
        {
                IOCLR0           |= 0x4000;



                S0SPDR   = 0x87;
                while (!(S0SPSR &amp;amp; SPIF));
                u32dummyData    = S0SPDR;

                S0SPDR = (BaseAdd&amp;gt;&amp;gt;8) &amp;amp; 0xFF;
                while (!(S0SPSR &amp;amp; SPIF));
                u32dummyData = S0SPDR;

                Delay(1000);
                S0SPDR = BaseAdd &amp;amp; 0xFF;
                while (!(S0SPSR &amp;amp; SPIF));
                u32dummyData = S0SPDR;

                BaseAdd++;

                S0SPDR = buffAdd1[k];
                while (!(S0SPSR &amp;amp; SPIF));
                u32dummyData = S0SPDR;

                IOSET0 |= 0x4000;
        }
}

&lt;/pre&gt;

&lt;p&gt;
&lt;b&gt;Here I am reading from SPI (S0SPDR register)&lt;/b&gt;&lt;/p&gt;

&lt;pre&gt;

void RdFromflash(unsigned int BaseAdd2,unsigned char size2,unsigned char *buffAdd2)
{
        unsigned char j;
        unsigned char u32dummyData2;

        IOCLR0 |= 0x4000;

        S0SPDR = 0xD6;                  //opcode for rading flash location
        while (!(S0SPSR &amp;amp; SPIF));
        u32dummyData2 = S0SPDR;

        S0SPDR = (BaseAdd2&amp;gt;&amp;gt;8) &amp;amp; 0xFF;
        while (!(S0SPSR &amp;amp; SPIF));
        u32dummyData2 = S0SPDR;

        S0SPDR = BaseAdd2 &amp;amp; 0xFF;
        while (!(S0SPSR &amp;amp; SPIF));
        u32dummyData2 = S0SPDR;


        for (j=0;j&amp;lt;size2;j++)
        {
                Delay(1000);
                S0SPDR = 0;                     //Dummy write
                while (!(S0SPSR &amp;amp; SPIF));
                buffAdd2[j] = S0SPDR;
        }
        IOSET0 |= 0x4000;

}
&lt;/pre&gt;

&lt;p&gt;
Here what happen I observed status on simulator.&lt;br /&gt;
all SPI register i observed all all modify according to my settings
except datar egister(S0SPDR), when I observed S0SPDR during writing
data,i am writing 0x87 but it is not modify,it only showing 0x00.at
that time my SPI transfer flag bit is set.&lt;br /&gt;
&lt;b&gt;so Is my (desired)data transfer is completed,if completed what
value it is transfer?&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
At the time of reading I am getting 0xFF on my hyperterminal.so
what will be exect issue?&lt;/p&gt;

&lt;p&gt;
Plz help me regarding this issue.and you can.because you are
allready done these things.&lt;br /&gt;
you can send your code on my mail ID&lt;br /&gt;
&lt;b&gt;shyam_tayade@rediffmail.com&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
wating for your positive reply.....&lt;/p&gt;

&lt;p&gt;
regards&lt;br /&gt;
Shyam T.&lt;br /&gt;
Pune India&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/77054?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2009 00:56:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f7dd31d7-f0bc-477f-93c5-d4796e42dfe7</guid><dc:creator>Aur&amp;#195;&amp;#169;lien MICHELVIOUX</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thank you so much for replying quickly !&lt;/p&gt;

&lt;p&gt;
First of all, I use an ascilloscope to check every signal. I
tested a lot of cases :&lt;br /&gt;
- with automatic drive by SSEL or with manual drive with a GPIO.&lt;br /&gt;
- with a polling of the slave&amp;#39;s status register prior to send each
command/ with the same polling but after each command / with no
polling.&lt;/p&gt;

&lt;p&gt;
The interesting information is :&lt;br /&gt;
- with auto drived SSEL , I managed to read the status register or
send short commands like &amp;#39;erase&amp;#39;. But when I send long commands (more
than 5 bytes), the SSEL sometimes deselect between 2 bytes. I think
this is why the behaviour wasn&amp;#39;t stable.&lt;/p&gt;

&lt;p&gt;
Yesterday I start again with a new, easier and clearer code. I
used a GPIO to drive manually the chip select. I finally succeed in
writing, reading and erasing some bytes. Now I need to improve my
code to allow it to support bigger data and with an higher speed.&lt;/p&gt;

&lt;p&gt;
But it remains a question concerning the auto drived SSEL.
According to the lpcxx user manual, &amp;#39;For continuous back-to-back
transmissions, the SSEL pins remains in its active LOW&lt;br /&gt;
state, until the final bit of the last word has been captured, and
then returns to its idle state&amp;#39;. I can&amp;#39;t find how and why this signal
is switching alhough it shouldn&amp;#39;t.&lt;/p&gt;

&lt;p&gt;
Thank you again for helping me and hope my work will help somebone
else !&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MCB2300 + SPI serial flash issue</title><link>https://community.arm.com/thread/53263?ContentTypeID=1</link><pubDate>Mon, 12 Jan 2009 04:05:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:8e4cbfc9-1b14-43ae-b02d-c8f012422737</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
You are not showing where you are setting your SSEL-signal in
relation to your reads and writes. Is it in SPI_ReadData() and
SPI_WriteData()?&lt;/p&gt;

&lt;p&gt;
I have been using the SSP and I had to drive the SSEL signal as
GPIO since the automatic drive did not correspond with my needs.&lt;/p&gt;

&lt;p&gt;
Are you waiting until the SSP device is idle before deselecting
SSEL? Note that the SSP has a FIFO so you can write multiple bytes to
it that it will then continue to send as fast as it can.&lt;/p&gt;

&lt;p&gt;
But with this as with most other problems relating communication:
Have you looked at the signaling with an oscilloscope? Based on the
oscilloscope view:&lt;br /&gt;
- what did you expect to happen?&lt;br /&gt;
- what did happen?&lt;br /&gt;
- what was the exact code involved?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>