[ECOS] Simple serial comms
Paul D. DeRocco
pderocco@ix.netcom.com
Fri Jul 3 07:19:00 GMT 2009
> From: grahamlab
>
> I mean that if I send more that 128 bytes some go missing.
> If I set the read to block and then send my bytes the ecos program blocks
> until several messages of 128 bytes have been receeived before unblocking
> and when it unblocks the message received is corrupted
It looks to me like this serial driver uses an interrupt per byte. My guess
is one of the following is wrong: 1) you've selected a very high bit rate;
2) you've misconfigured eCos, and the CPU is running at a slow clock rate,
or 3) there is some other source of interrupts erroneously keeping the CPU
busy.
If the answer is 1, and you really need to speed things up, this driver
could be rewritten to use DMA. I would recommend using DMA into a buffer
large enough to capture, say, 15ms worth of data, and then using the 10ms
timer interrupt to transfer data from the DMA buffer to the user buffer. But
that would be a complete rewrite. You'd learn quite a bit about the eCos
interrupt and device driver structure, but it's nontrivial.
--
Ciao, Paul D. DeRocco
Paul mailto:pderocco@ix.netcom.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
More information about the Ecos-discuss
mailing list