<?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>Need Helpb related SPI communication LPC2378</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24928/need-helpb-related-spi-communication-lpc2378</link><description> 
Dear Sirs, 
Here I am trouble in SPI communication (LPC2378 master mode).I set
all registers properly. 
whenever I writing opcode (any value) on S0SPDR (data register),data
transfer flag is set.but S0SPDR register showing 00 (zero).ie. I am
not able</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Need Helpb related SPI communication LPC2378</title><link>https://community.arm.com/thread/101547?ContentTypeID=1</link><pubDate>Fri, 16 Jan 2009 04:33:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:acbd8cca-324b-430c-8146-9851e159f438</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Dear Sir&lt;br /&gt;
Thanks for replying,&lt;br /&gt;
I got solution, now my SPI communication is working.&lt;br /&gt;
I found in trouble when I was sending dummy data.&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: Need Helpb related SPI communication LPC2378</title><link>https://community.arm.com/thread/101546?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2009 23:30:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:11b3e5b8-472f-4b74-8165-fd6f293e8501</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Thanks for reply.&lt;br /&gt;
ok, that is why i was not able to observe dataregister (S0SPDR).&lt;br /&gt;
Today I on my UART and send each responce on hypertermanil.I observe
that when i send my write opcode (0x87)than at same time i read
responce and send it to hyperterminal I got OxFF reponce on
hyperterminal.what it means? Is opcode is appropriate reach to
dataflash or not?&lt;/p&gt;

&lt;p&gt;
wating for ur reply....&lt;/p&gt;

&lt;p&gt;
Regards&lt;br /&gt;
shaym 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: Need Helpb related SPI communication LPC2378</title><link>https://community.arm.com/thread/89500?ContentTypeID=1</link><pubDate>Wed, 14 Jan 2009 22:32:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4b740c7b-f5ec-4907-a47b-9c8981cd4575</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Writing a byte to the data register does not always mean that you
can read back what you wrote. Reading from the register is intended
to read the received data, not the data you are about to send. But
you have to give the chip time to perform a transfer until there will
be something to receive. And if you run in the simulator, then you
must write a simulator script that will react to the SPI transfer and
return back anything - the simulator don&amp;#39;t have real MISO and MOSI
signals to perform SPI communication on.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need Helpb related SPI communication LPC2378</title><link>https://community.arm.com/thread/53271?ContentTypeID=1</link><pubDate>Tue, 13 Jan 2009 03:16:32 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:07a14622-7c87-47af-93a7-85dfb53db8f6</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Dear sirs&lt;br /&gt;
Here I am doing 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.&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></channel></rss>