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 | A word or two of thanks and some SPI info, (LPC2129)

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

A word or two of thanks and some SPI info, (LPC2129) - mjames_doveridge - Jul 4 12:23:52 2008

..to those here who recently responded to my query about SPI/FIQ
interrupts with useful hints and even more useful examples.

Thanks to your help, I now have my SPI working OK, though it's a
little kludgy so far:

In the initialization, I 'manually' load up the RAM FIQ vector at
0x4000001C with a 'mov pc,r8' instruction word, then, in the
read/write/whatever functions, I switch to FIQ mode, load paramters
and set r8 to point at the required interrupt handler, then set off
the read/write by loading the SPI data register.

The interrupt handler runs with each interrupt, reading/writing bytes,
until a count has expired, at which time the handler disables the FIQ
by settting bit 10, (SPI), in the VICIntEnClear. The handler then
sets bit 1 in the VICSoftInt register and exits. This causes an IRQ
level 1 whose handler I have set up to signal a ctl semaphore. I
found out that this handler must explicitly clear the IRQ with a
'VICSoftIntClear=2;' to prevent the IRQ interrupt firing again
immediately the handler exits. The sending of the semaphore unit
enables my SPI handling thread to continue after the read/write call
is done.

Summary - my first experiment with ARM assembler actually works :)

I have a fully-functioning SPI interrupt driver. I have given some
detail above in case it might help others - you don't have to poll!

Thanks again, everyone who helped, (inc. Rowley/Crossworks).

Now I have to remove all the kludges and commented-out bad code

Next, I will try to load it into .fasttext section.

Rgds,
Martin

------------------------------------



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