To answer "How could ignoring framing errors possibly help?": There are a number of situations that this would help.
The basic issue is: if a framing error occurs before (or at the start of preamble) for an Ir packet (ex: any IrDA packet), the entire packet will be lost because the serial manager forces you to call serClearErr (which takes longer to execute than there are preamble characters) in order to continue reading/receiving characters. If you're fortunate enough to have a pile of m100's on your desk, you'll find that some of them will absolutely refuse to beam items if you place them just right (well within the IrDA specified operating conditions). You'll find that some are worse than others. I've found a few that when placed approximately 4 inches from each other, with indirect sunlight in the office, would not beam... but if you moved one so that the separation was 5 inches, they worked fine. This behaviour is affected by ambient lighting (the range can vary significantly) and is worsened in the presence of other optical noise sources. Inside this IrDA "dead zone" the very first start bit of an IrDA packet is distorted (it's much wider than it should be). That is not necessarily a design flaw in the IrDA module - it is mentioned in many IrDA module spec sheets that the first few pulses may be distorted. Design flaw or not, it exists. An IrDA packet starts off with several 0xff's... so the only optical pulse is the start bit. If the start bit is too wide, the 68328 UART incorrectly determines the bit boundaries such that it thinks the next byte's start bit lands in the first byte's stop bit slot, thus causing a framing error. If framing errors were ignored, then the UART receive buffer would contain the first valid 0xff (marked with a framing error, but the data is still valid), the second byte would be missed, and normal operation would resume at the third byte (also 0xff). IrDA does not require reception of all preamble bytes for correct operation. A series of 0xff's has the convenient property of automatically correcting framing no matter how mangled the previous bytes were. There... I think I explained it adequately. :) -Daryl. >From: Jim Schram <[EMAIL PROTECTED]> >Reply-To: "Palm Developer Forum" <[EMAIL PROTECTED]> >To: "Palm Developer Forum" <[EMAIL PROTECTED]> >Subject: Re: Serial Manager - Framing Errors >Date: Thu, 3 Jan 2002 11:21:56 -0800 > >At 10:34 AM -0800 2002/01/03, Daryl Van Vorst wrote: > >Is it possible to make the Palm OS Serial Manager ignore framing errors? > >Nope. > > > >Or, alternatively, is there a way to make it recover from them without >calling SerClearErr or resetting the serial port? > >Nope. > >Curious... how could ignoring framing errors possibly help? What are you >trying to do? > >Regards, > >Jim Schram >Palm Incorporated >Partner Engineering > > >-- >For information on using the Palm Developer Forums, or to unsubscribe, >please see http://www.palmos.com/dev/tech/support/forums/ _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
