public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] eb40a Interrupt, TC
@ 2003-10-21 18:07 Carlos Perilla
  2003-10-23 14:34 ` Nick Garnett
  0 siblings, 1 reply; 2+ messages in thread
From: Carlos Perilla @ 2003-10-21 18:07 UTC (permalink / raw)
  To: ecos

Well , finally I got two  timers running, with the conf I want, Now I 
need to capture the interrupts that my configuration is generating, as 
long as the TC_SR says the events that I have programed had passed but 
not attended.

I have set the ISR and DSR like this:

cyg_uint32 interrupt_TC1_isr(
               cyg_vector_t vector,
               cyg_addrword_t data) //Based  on eCos book, pag 48
{
  cyg_interrupt_mask(vector);
  cyg_interrupt_acknowledge(vector);
  return(CYG_ISR_HANDLED | CYG_ISR_CALL_DSR);

}
void interrupt_TC1_dsr(
              cyg_vector_t vector,
              cyg_ucount32 count,
              cyg_addrword_t data)
{
  HAL_IO_REGISTER REGISTER;
  cyg_semaphore_post(&TC1_data_ready);
  REGISTER=TC_BASE+TC_CHANNEL1+TC_RA;
  HAL_READ_UINT16(REGISTER,TC1_PERIOD);
  REGISTER=TC_BASE+TC_CHANNEL1+TC_RB;
  HAL_READ_UINT16(REGISTER,TC1_HIGH);
  cyg_interrupt_unmask(vector);
}

And I have created in the CYG_USER_START

 cyg_interrupt_enable();
  cyg_interrupt_create(
               intTC1_vector,
               intTC1_priority,
               0,
               &interrupt_TC1_isr,
               &interrupt_TC1_dsr,
               &intTC1_handle,
               &intTC1);
  cyg_interrupt_attach(intTC1_handle);
  cyg_interrupt_unmask(intTC1_vector);

  cyg_semaphore_init(&TC1_data_ready,TC1_data_ready_counter);
  cyg_semaphore_init(&TC1_trans,TC1_trans_counter);
  cyg_semaphore_init(&TC1_end_trans,TC1_ent_trans_counter);

Im using two other threads to capture and transmit the data I get from 
here, still the Interrupt Isn't captured, and the program keeps waiting 
for the semaphore signal.

Thanks you all.

Carlos Perilla.



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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [ECOS] eb40a Interrupt, TC
  2003-10-21 18:07 [ECOS] eb40a Interrupt, TC Carlos Perilla
@ 2003-10-23 14:34 ` Nick Garnett
  0 siblings, 0 replies; 2+ messages in thread
From: Nick Garnett @ 2003-10-23 14:34 UTC (permalink / raw)
  To: Carlos Perilla; +Cc: ecos

Carlos Perilla <transfers@phaber.com> writes:

> Well , finally I got two  timers running, with the conf I want, Now I
> need to capture the interrupts that my configuration is generating, as
> long as the TC_SR says the events that I have programed had passed but
> not attended.
> 

> 
> Im using two other threads to capture and transmit the data I get from
> here, still the Interrupt Isn't captured, and the program keeps
> waiting for the semaphore signal.
> 

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.



-- 
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-10-23 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-21 18:07 [ECOS] eb40a Interrupt, TC Carlos Perilla
2003-10-23 14:34 ` Nick Garnett

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).