public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Simple serial interrupt question (Atmel AT91)
@ 2001-06-10 23:44 harri.siirtola
  2001-06-21  3:35 ` Jonathan Larmour
  0 siblings, 1 reply; 2+ messages in thread
From: harri.siirtola @ 2001-06-10 23:44 UTC (permalink / raw)
  To: ecos-discuss

I have my interrupt-driven serial I/O almost working. It uses a DSR routine
and is modified from PID serial implementation. I try to send a short
string to this port (AT91X40 port 1, secondary) with cyg_io_write(). The
problem is:

Running without breaks results to the first two characters to appear at the
port. Setting a breakpoint to my xxx_serial_putc() gives the whole string,
char by char of course.

So, what does the breakpoint execution do (with interrupt acknowledge or
something else) that I should add to my implementation?

BTW, trying to send the string in a loop, xxx_serial_start_xmit() seems to
be called once for each cyg_io_write() call but xxx_serial_stop_xmit() is
called once before the first cyg_io_write() call. What's the role of these
functions?

Thanks,
	Harri

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

* Re: [ECOS] Simple serial interrupt question (Atmel AT91)
  2001-06-10 23:44 [ECOS] Simple serial interrupt question (Atmel AT91) harri.siirtola
@ 2001-06-21  3:35 ` Jonathan Larmour
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2001-06-21  3:35 UTC (permalink / raw)
  To: harri.siirtola; +Cc: ecos-discuss

[ bit late I know ]

harri.siirtola@vtt.fi wrote:
> 
> I have my interrupt-driven serial I/O almost working. It uses a DSR routine
> and is modified from PID serial implementation. I try to send a short
> string to this port (AT91X40 port 1, secondary) with cyg_io_write(). The
> problem is:
> 
> Running without breaks results to the first two characters to appear at the
> port. Setting a breakpoint to my xxx_serial_putc() gives the whole string,
> char by char of course.
> 
> So, what does the breakpoint execution do (with interrupt acknowledge or
> something else) that I should add to my implementation?

With a breakpoint, the serial port uses polled mode, not interrupts, so it
wouldn't ack the interrupt. It would just test the status and read bytes.
 
> BTW, trying to send the string in a loop, xxx_serial_start_xmit() seems to
> be called once for each cyg_io_write() call but xxx_serial_stop_xmit() is
> called once before the first cyg_io_write() call. What's the role of these
> functions?

start_xmit ensures the transmitter is going. Generally, it makes sure the
"TX holding register empty" interrupt is enabled. stop_xmit disables it
when we don't want to send anything more - otherwise you'll keep on getting
that interrupt while its empty even though you've nothing to send.

Jifl
-- 
Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062
Maybe this world is another planet's Hell -Aldous Huxley || Opinions==mine
Come to the Red Hat TechWorld open source conference in Brussels!
Keynotes, techie talks and exhibitions    http://www.redhat-techworld.com/

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

end of thread, other threads:[~2001-06-21  3:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-10 23:44 [ECOS] Simple serial interrupt question (Atmel AT91) harri.siirtola
2001-06-21  3:35 ` Jonathan Larmour

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