This is the mail archive of the ecos-discuss@sourceware.org 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]

ISR problem


Hi all,

 i am working on x86 PC platform. At present i am
using on board serial port COM1 for serial
communication. I can use ?ser0? driver but I am doing
it by directly accessing the registers. (Using
HAL_XXX_UINT8). At present I am receiving data by
polling method. But I want it to be through ISR. So
for that purpose I used ?cyg_interrupt_create?. I am
giving a small model of my code here:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

uartinit(struct data) // the data here is a structure
having base address, baud, parity etc.
 {
	Disable interrupt 

Set baud, parity, data bits, parity etc by directly
writing on registers using ?HAL_XXX_UINT8? 

Enable interrupts

Create ISR, I am giving detailed code of interrupt
creation here

cyg_interrupt_create( vector , 5, (cyg_addrword_t)
base, my_serial_ISR, my_serial_DSR,  my_intr_hdlr,
&my_intr_obj);

//   I tried with  vector = 12  &  32  &  38

cyg_interrupt_attach(my_intr_hdlr);
cyg_interrupt_unmask( vector);


}

static cyg_uint32 my_serial_ISR(cyg_vector_t vector,
cyg_addrword_t data)
{
    
	cyg_drv_interrupt_mask(vector);

	printf("\came to interrupt");

	cyg_drv_interrupt_acknowledge(vector);

    	return CYG_ISR_CALL_DSR;  // Cause DSR to be run
}



static void my_serial_DSR(cyg_vector_t vector,
cyg_ucount32 count, cyg_addrword_t data)
{
		Here I am checking LSR for any received data. If
received then storing that data in a buffer.   


    cyg_drv_interrupt_unmask(v2);
}

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

The problem what I am facing is that, in polling
method I am receiving data very smoothly but, through
ISR I am not getting any data.

The three vector numbers what I used are 12 (it is
vector used in windows to attach ISR in windows), 32
(this is the default vector number I found in ecos
config tool), 36 (this the vector number assigned
through CDL for ser0), but all three vector number
didn?t make the ISR active.

One doubt I am having, how can we know that what
vector number is assigned to the IRQ of a port.
Whatever is the type of port? 

Please can some one tell me the correct vector number
of COM1 for x86 PC in eCos. 

Please help me.

Thanks to all 

Regards,
Ram Kumar


Send instant messages to your online friends http://in.messenger.yahoo.com 

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


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