This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ eb40a Interrupt, TC]


Carlos Perilla <transfers@phaber.com> writes:

> Nick Garnett wrote:
> 
> >
> > You should not be calling cyg_interrupt_enable(). This is done
> > implicitly when the scheduler is started. Calling it before then can
> > allow interrupts to be delivered to code that is not yet ready.
> >
> > The code you have posted seems fine as far as it goes. Check that you
> > have used the right vector number.
> >
> > Your code does not show where you are setting up the timer  device. I
> > suspect that this is where the problems are to be found. Have you, for
> > example, set the correct interrupt enable bit for the timer mode you
> > are using.
> >
> >
> >
> >
> Well, I got what the problem was, a missplaced bit, now I have the
> problem that the  interrupt is taking over the system.
> I disabled the interrupt and created a thread that peeks on RA, and
> RB, and everything it's working.
> The signal I'm measuring is 1Khz and I'm placing a Interrupt on the
> rising edge, it's too fast?
> I don't think so, but I think it's more about my slow code, any ideas?
> 

1KHz should be perfectly acceptable -- it's the same sort of interrupt
rate as running a serial line at 9600 baud.

The most likely cause of the interrupt swamping the system is that you
are not cancelling the cause properly. Check whether there are other
things that you need to do other than read RA and RB.

Also, given that you are not calling out into other code, you probably
don't need to defer the device access to the DSR, you can do all that
in the ISR, eliminating the masking/unmasking of the interrupt.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]