Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | SSP on LPC2368

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

SSP on LPC2368 - "d.holzwarth" - Sep 20 9:43:33 2007

hello everyone

now that I (hopefully) understand the SPI I need some help with the
SSP interface in SPI mode.

I have a LPC2368 which is connected to an audio-codec (TI's AIC23)
over the SSP interface. I need that interface only to configure the
AIC23 (control data, the actual audio data goes over I2S) so all I
wanna do is send some frames (16bit frames) to the codec and thats it
(dont receive anything and its an one-time transmition only).

the reason why I need to ask in here again is the following:

all example code I found is polling the TNF and BSY bits, even inside
the SSP ISR... also the 4 ISR events you have in SSP are a bit odd to
me. three of them are received-FIFO related so they are no use to me
(as i'm not receiving data). the last one is "interrupt when Tx FIFO
is at least half empty".

I'm not completely sure how this interrupt behaves. After the SSP
init, when you never wrote something into the Tx FIFO yet I guess it
is empty, right?
So after the initialization does the system get "spammed" with
those "Tx FIFO is half empty" interrupts?

my very first idea of implemention was the following:
- at start the FIFO is empty and ISR fires (a lot? ^^)
- every time the ISR fires I write a frame into the Tx FIFO
- eventually at some point I m done with writing and can basicly
disable the SSP, or:
- I'm not done with sending my data yet but the Tx FIFO is now more
than half FULL so the ISR stops firing.
- I need to wait with writing data into the FIFO until the next ISR
event fires again (meaning that the FIFO is now a little bit "more
empty" now ^^)

however, I dont know how I should handle the BSY bit in this case (do
you really have to poll it?) and also I would find it a bit strange
if at startup you get loads of "Tx FIFO half empty" interrupts... so
as I said I'm not sure if thats the case or not...

would be nice if someone again could explain me how I should
implement an interrupt-driven data transfer (sending)!

thanks again in advance

D. Holzwarth


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: SSP on LPC2368 - "d.holzwarth" - Sep 20 15:39:18 2007

just wanted to let you guys know that I probably gonna use the
simple "polling method" anyway. since I only need to send data on the
initialisation part of my code it shouldnt really be time-critical so
polling shouldnt be a problem... :-)

however if some1 still has a good/working idea on howto use those
strange SSP interrupts feel free to post it in here as I'm kinda
curious to know how that would work ;-)


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: SSP on LPC2368 - hrivdin - Sep 21 13:15:40 2007

--- In l...@yahoogroups.com, "d.holzwarth"
wrote:
>
> just wanted to let you guys know that I probably gonna use the
> simple "polling method" anyway. since I only need to send data on
the
> initialisation part of my code it shouldnt really be time-critical
so
> polling shouldnt be a problem... :-)
>
> however if some1 still has a good/working idea on howto use those
> strange SSP interrupts feel free to post it in here as I'm kinda
> curious to know how that would work ;-)
>
/********************************************************************
********/
// Get or send a byte to SSP0 port
/********************************************************************
********/
BYTE SPI0_byte(BYTE buf) //
{
BYTE Dummy;

IOCLR1 = SPI1_SEL; // drop /cs
SSP0DR = buf; // drop data into spi

while (SSP0SR & SSPSR_BSY); // wait for transmit to finish

Dummy = SSP0DR; // Read the Data back

return Dummy;
} // end of function SPI0_byte
/********************************************************************
*********/

Enjoy..


(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )