MPC565 Queued SCI receive problem
[email protected] Mon, 31 Jul 2006 14:24:55 -0400
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <OF5809EE51.6B220A92-ON852571BC.006429B0-852571BC.0064B423@inficon.com> |
Dear group,
I have been using the MPC565?s QSCI receive queue successfully for some
time.
I run at 115,200 baud. Recently I have come across a situation that causes
it to fail.
If a packet of characters contains at least one intercharacter delay of
just over one
character time the idle interrupt occurs just prior to the next receive
character arrival.
When executing the idle ISR the queue is cleared with this received
character.
Does anyone have any idea how I can fix this problem? My code is as
follows:
void imb_IRQ1_ISR (void)
{ /* SCI_A interrupts (Com1,Com2) */
U16 status;
U08 sciData,i;
//Com1
status = QSMCM_A.SC1SR.R; /* check Com1 QSMCM 'A' SCI 1 */
if(QSMCM_A.QSCI1SR.B.QTHF)
{
QSMCM_A.QSCI1SR.B.QTHF = 0; /* clear QTHF bit */
for(i = 0; i < 8; i++)
{
RxCount1++;
enquei(Com1RxQ, (U08)QSMCM_A.SCRQ[i].R);
}
Com1QueRxNextFramePointer = 8;
}
if(QSMCM_A.QSCI1SR.B.QBHF)
{
QSMCM_A.QSCI1SR.B.QBHF = 0; /* clear QBHF bit */
for(i = 8; i < 16; i++)
{
RxCount1++;
enquei(Com1RxQ, (U08)QSMCM_A.SCRQ[i].R);
}
Com1QueRxNextFramePointer = 0;
}
if(QSMCM_A.SC1SR.B.IDLE)
{
for(i = Com1QueRxNextFramePointer; i < QSMCM_A.QSCI1SR.B.QRPNT; i++)
{
RxCount1++;
enquei(Com1RxQ, (U08)QSMCM_A.SCRQ[i].R);
}
for(i=0; i<16; i++) /* clear IDLE bit */
sciData = QSMCM_A.SCRQ[i].R;
QSMCM_A.QSCI1CR.B.QRE = 0; /* Clear then Set QRE to reset QRPNT */
QSMCM_A.QSCI1CR.B.QRE = 1;
Com1QueRxNextFramePointer = 0;
}
if (status&0x000F)
{
ComErrors[0] |= status&0x000F;
sciData = (char)QSMCM_A.SC1DR.R; /* clear status register */
RxErrorCount1++;
}
}
Best Regards,
Peter Santariello
Software Engineer
INFICON
2 Technology Place
East Syracuse, NY 13057
+1.315.434.1150 (voice)
+1.315.434.1273 (fax)
[email protected] (e-mail)
http://www.inficon.com
***********************************************************************
NOTICE: - This message including any attachments is intended only for the
use of the designated recipient(s) named above and may contain
confidential information protected by law. If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
distribution, or the taking of any action in reliance on the contents of
this information is strictly prohibited. If you have received this
transmission in error, please notify the sender immediately by e-mail and
delete the original message including any attachments.
***********************************************************************
[Non-text portions of this message have been removed]
-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/MPC500/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/