Re: UART receive ISR receives 1st 2 bytes twice
- From: Ico <usenet@xxxxxxx>
- Date: 31 Oct 2006 10:16:57 GMT
galapogos <goister@xxxxxxxxx> wrote:
Hi,
I'm trying to read data from a smart card via a Toshiba 16bit MCU's
UART interface set at a slow 4+K baudrate. My receive ISR however seems
to pull out the 1st 2 bytes of the transmission from the receive buffer
twice. i.e., when the smart card sends 0x1, 0x2, 0x3, ..., 0xa, My
receive ISR will receive 0x1, 0x2, 0x1, 0x2, 0x3, ...,0xa. I've checked
the I/O line with a logic analyzer and the smart card isn't resending
the 1st 2 bytes. I've checked the bit period on both the MCU and smart
card and they both agree(i.e. similar baudrate) so it's not a
synchronization problem either.
Does anyone know what might be causing it? My receive ISR is simple,
and currently does no error checking:
ISR() {
fifo[i++] = receivebuffer
}
I've tried putting in breakpoints when when i == 2 in the ISR, and
indeed the receivebuffer is 0x1 rather than 0x3, so the ISR seems to be
doing its job just fine, except the receivebuffer doesn't seem to have
the right data.
Any ideas? Thanks!
Is reading the 'receivebuffer' register enough ? Maybe your UART needs
special treatment to tell it you have read the buffer so at can clear
the interrupt ?
--
:wq
^X^Cy^K^X^C^C^C^C
.
- References:
- UART receive ISR receives 1st 2 bytes twice
- From: galapogos
- UART receive ISR receives 1st 2 bytes twice
- Prev by Date: UART receive ISR receives 1st 2 bytes twice
- Next by Date: Re: AT91RM9200 problems to run from SDRam
- Previous by thread: UART receive ISR receives 1st 2 bytes twice
- Next by thread: KWP
- Index(es):
Relevant Pages
|