ts-7000
[Top] [All Lists]

[ts-7000] Re: VIC, IRQ and FIQ programming for the EP9302

To:
Subject: [ts-7000] Re: VIC, IRQ and FIQ programming for the EP9302
From: "charliem_1216" <>
Date: Wed, 02 Jul 2008 13:34:27 -0000
Hi --

--- In  Per Öberg <> wrote:
>
> Hi everyone
>
> I'm writing my own OS for my TS7250. I use redboot for basic
> initialization and then i take over with my own code.
>
> I've been reading "EP93xx_Users_Guide_UM1.pdf" but I can't understand
> what I am doing wrong when programming the VIC. The documentation is a
> little hard to follow and I'm not sure about how the prioritizing

You need the ARM ARM (Architecture Reference Manual) too, I think. 

> hardware works for example. Links to code examples or extra
> documentation would come in really handy.
>
> The scenario is as follows:
>
> A process is running in system mode with it's own stack and with FIQ
and
> IRQ turned on. The GPIO's are programmed to to generate a FIQ when a
key
> on the keypad is pressed or released. The 508 kHz clock is

Are you sure you want to use FIQ for the keypad?  FIQ is deep magic,
with many restrictions on what's allowed, but *will* fire your isr in
1 uS regardless of what else the chip is doing (even if it is most
inopportune).

See:
http://warmcat.com/_wp/2007/09/17/at91rm9200-fiq-faq-and-simple-example-code-patch/

and example code (c handler):
http://marc.info/?l=linux-arm-kernel&m=118604198319632&w=2

and the thread starting at:
http://marc.info/?l=linux-arm-kernel&m=119644757309704&w=2

and for a cool project using FIQ:
http://www.pabr.org/pxarc/doc/pxarc.en.html

These are all talking about using FIQ under linux, but I think FIQ
limitations & tricks will apply to your OS too.

programmed to
> generate a vectorized IRQ and is coupled to a clock handler function. I
> also have a default IRQ handler that flashes the green light on my
board
> but all other interrupts are turned off so it shouldn't be needed.
>
> The FIQ handler routine, written in assembler with C-calls, stashes
away
> all registers that is going to be modified. It then turns off the GPIO
> interrupts and reprograms PortB, scans the keyboard and finally
> reenables the GPIO interrupts. B.t.w does anyone know why gcc favours
> register 0-3 even when told to generate code for a FIQ routine
> regardless of optimization flags?

The consensus of the above threads is that while some versions of gcc
may work by luck, FIQ handlers really need to be straight assembler code.

Regards, ................... Charlie




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

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
    
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU