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]

Re: ISR problem


I checked the serial driver 'ser0'. That is working
well. I used ?cyg_io_read & write? for testing.

 I found that ISR & DSR of 'ser0' are taken from
'generic 16x5x' for x86 PC. But I want my own
implementation in DSR. I am having a global buffer in
which I have to save the received data.
 I am giving the implementation code of my own ISR &
DSR.
Please suggest me, what I did wrong in my code.


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

// all initialization related register operations
(baud, parity etc.)

// ISR creation	

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);
}

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

Thanks & Regards,
Ram kumar


--- Andrew Lunn <andrew@lunn.ch> wrote:

> On Fri, Dec 30, 2005 at 12:06:30PM +0000, ram kumar
> wrote:
> > 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).
> 
> Why? What is wrong with the eCos serial driver?
> 
> > 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. 
> 
> How about first using the eCos serial driver and
> checking that works
> correctly. If it does, you then know the vector to
> uses.
> 
>         Andrew
> 


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]