<?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>how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/23424/how-to-interface-spi-with-arm-lpc2378</link><description> 
how i should configure spi at45db161 

 
tell me some basic idea 
how to read and write 
thank you 
 </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/thread/125173?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2009 21:42:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6dbce796-2727-4874-b036-a1d7e12ab998</guid><dc:creator>ganesh badgujar</dc:creator><description>&lt;p&gt;&lt;p&gt;
thank you sir,&lt;/p&gt;

&lt;p&gt;
actulally i m not getting sck clock from the processor,&lt;br /&gt;
i checked that pin on CRO .&lt;br /&gt;
in lpc user manual they given that in master mode clock counter value
is even and equal to 8 or greater than this.&lt;br /&gt;
i initialised tthat value also but then also i m not getting sck on
that pin.&lt;br /&gt;
whenever i get clock then i will go ahead.&lt;br /&gt;
this is my code ..&lt;br /&gt;
&amp;lt; pre&amp;gt;&lt;br /&gt;
int main (void)&lt;br /&gt;
{&lt;/p&gt;

&lt;p&gt;
SYS_TargetResetInit();&lt;/p&gt;

&lt;p&gt;
PCONP |= (1 &amp;lt;&amp;lt; 8);&lt;/p&gt;

&lt;p&gt;
/* by default, it&amp;#39;s enabled already, for safety reason */ PINSEL0
|= 0xC0000000;&lt;/p&gt;

&lt;p&gt;
PINSEL1 |= 0x0000003C;&lt;/p&gt;

&lt;p&gt;
S0SPCCR = 0x8;&lt;/p&gt;

&lt;p&gt;
S0SPCR = 0x000;&lt;/p&gt;

&lt;p&gt;
}&lt;/p&gt;

&lt;p&gt;
void SYS_TargetResetInit(void)&lt;br /&gt;
{&lt;/p&gt;

&lt;p&gt;
SCS |= 0x20;&lt;/p&gt;

&lt;p&gt;
/* Enable main OSC */&lt;/p&gt;

&lt;p&gt;
while( !(SCS &amp;amp; 0x40) );&lt;/p&gt;

&lt;p&gt;
/* Wait until main OSC is usable */&lt;/p&gt;

&lt;p&gt;
CLKSRCSEL = 0x1;&lt;/p&gt;

&lt;p&gt;
/* select main OSC, 12MHz, as the PLL clock source */&lt;/p&gt;

&lt;p&gt;
PCLKSEL0 = 0x55555555;&lt;/p&gt;

&lt;p&gt;
/* PCLK is the same as CCLK */&lt;/p&gt;

&lt;p&gt;
PCLKSEL1 = 0x55555555;&lt;/p&gt;

&lt;p&gt;
SYS_GPIOResetInit();&lt;/p&gt;

&lt;p&gt;
}&lt;br /&gt;
.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/thread/125172?ContentTypeID=1</link><pubDate>Wed, 07 Jan 2009 21:36:09 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7da1853e-0b00-4173-aaac-091a89d7a0fb</guid><dc:creator>ganesh badgujar</dc:creator><description>&lt;p&gt;&lt;p&gt;
thank you sir,&lt;/p&gt;

&lt;p&gt;
actulally i m not getting sck clock from the processor,&lt;br /&gt;
i checked that pin on CRO .&lt;br /&gt;
in lpc user manual they given that in master mode clock counter value
is even and equal to 8 or greater than this.&lt;br /&gt;
i initialised tthat value also but then also i m not getting sck on
that pin.&lt;br /&gt;
whenever i get clock then i will go ahead.&lt;br /&gt;
this is my code ..&lt;br /&gt;
int main (void)&lt;br /&gt;
{ SYS_TargetResetInit(); PCONP |= (1 &amp;lt;&amp;lt; 8);&lt;br /&gt;
/* by default, it&amp;#39;s enabled already, for safety reason */ PINSEL0 |=
0xC0000000; PINSEL1 |= 0x0000003C; S0SPCCR = 0x8; ** how much value i
should enter&lt;br /&gt;
i tried so many freqvency above 0x8 S0SPCR = 0x000;&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
void SYS_TargetResetInit(void)&lt;br /&gt;
{ SCS |= 0x20;&lt;br /&gt;
/* Enable main OSC */ while( !(SCS &amp;amp; 0x40) );&lt;br /&gt;
/* Wait until main OSC is usable */ CLKSRCSEL = 0x1;&lt;br /&gt;
/* select main OSC, 12MHz, as the PLL clock source */ PCLKSEL0 =
0x55555555;&lt;br /&gt;
/* PCLK is the same as CCLK */ PCLKSEL1 = 0x55555555;
SYS_GPIOResetInit();&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
thank u&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/thread/114569?ContentTypeID=1</link><pubDate>Tue, 06 Jan 2009 03:30:52 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:e9dcf0be-9363-4978-ba25-2aa581d5af7a</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
The instructions for posting source code are very clear and easy
to follow:&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.danlhenry.com/caps/keil_code.png"&gt;www.danlhenry.com/.../keil_code.png&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
If you can miss something so obvious as that, and not even notice
the problem in the Preview or in the actual post - and do it
&lt;b&gt;twice&lt;/b&gt; - then it is very likely that you have missed important
details in the NXP documentation.&lt;/p&gt;

&lt;p&gt;
Go back to the NXP documentation and &lt;b&gt;study it
&lt;i&gt;thoroughly&lt;/i&gt;...&lt;/b&gt;&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/thread/101520?ContentTypeID=1</link><pubDate>Tue, 06 Jan 2009 03:18:15 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:52bef147-ba75-4d3f-a1ad-0e9604c404b3</guid><dc:creator>ganesh badgujar</dc:creator><description>&lt;p&gt;&lt;p&gt;
thank u&lt;br /&gt;
i written this code for simple raed and write operation with spi&lt;br /&gt;
but i m not getting&lt;/p&gt;

&lt;p&gt;
InitSPI();&lt;/p&gt;

&lt;p&gt;
IOCLR0 = SPI0_SEL; Write_SPI(0x84); // opcode Write on buffer 1
Write_SPI(0x00); Write_SPI(0x55); // data into buffer 1&lt;/p&gt;

&lt;p&gt;
// data = Read_SPI();&lt;/p&gt;

&lt;p&gt;
Write_SPI(0x83); //opcode buff to MM Write_SPI(0x00); // location
of MM Write_SPI(0x00); // location of MM Delay(1000);&lt;/p&gt;

&lt;p&gt;
Write_SPI(0x54); // Read opcode for buffer 1 Write_SPI(0x00); //
bufffer address&lt;/p&gt;

&lt;p&gt;
Delay(1000); data = Read_SPI(); TransmitChar0(data&amp;gt;&amp;gt;8);
TransmitChar0(data);&lt;/p&gt;

&lt;p&gt;
}&lt;br /&gt;
/***************************************** /* main end */&lt;br /&gt;
void InitSPI(void)&lt;br /&gt;
{ PCONP |= (1 &amp;lt;&amp;lt; 8); PINSEL0 |= 0xC0000000; //P0.15 PINSEL1 |=
0x0000003C; //P0.16,P0.17,P0.18 PCONP |= (1 &amp;lt;&amp;lt; 8); S0SPCR =
0x00; IODIR0 = SPI0_SEL; IOSET0 = SPI0_SEL; S0SPCR = 0x20; S0SPCCR =
0x96; // Check it first&lt;br /&gt;
}&lt;/p&gt;

&lt;p&gt;
void Write_SPI(unsigned char spiTx)&lt;br /&gt;
{ S0SPDR = spiTx; while(!(S0SPSR &amp;amp; SPIF));&lt;br /&gt;
} unsigned char Read_SPI()&lt;br /&gt;
{ unsigned char spiRx; spiRx = S0SPDR; return (spiRx);&lt;br /&gt;
} void SPI_ISR (void) __irq&lt;br /&gt;
{ S0SPINT = 0x01;&lt;/p&gt;

&lt;p&gt;
VICVectAddr = 0x00000000;&lt;br /&gt;
}&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/thread/89488?ContentTypeID=1</link><pubDate>Mon, 05 Jan 2009 22:05:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:94e195a5-a16d-4f35-9747-1cb8ab57535d</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
Are you going to transfer data in both directions? I don&amp;#39;t know
about the AT45DB161, but the LPC2378 has DMA or FIFO which means that
it can run as slave at very high speeds without having troubles
picking up incoming data.&lt;/p&gt;

&lt;p&gt;
A lot of processors only have a single shift register for
incoming/outgoing transfers, so you may have a very short time to
pick up the just received byte before it gets overwritten by the next
bit on the way in from the master.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to interface  spi  with arm lpc2378</title><link>https://community.arm.com/thread/53219?ContentTypeID=1</link><pubDate>Mon, 05 Jan 2009 21:48:42 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:630e76af-1fe9-445e-b8d5-40229ab8c7ce</guid><dc:creator>shyam ST</dc:creator><description>&lt;p&gt;&lt;p&gt;
Plz go through datasheet of AT45DB161 dataflash.&lt;br /&gt;
and usermanual of LPC 2378.You will get idea for interfacing.&lt;/p&gt;

&lt;p&gt;
Shaym T.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>