|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Anyone used the XMega128A1 IrCOM module? Inverted output?Anyone used the XMega128A1 IrCOM module?
To me it seems that the output state of the module is inverted from what is normal for driving IrDA transceivers, like the Vishay TFDU4300. This makes IrDA reception difficult. For a point of reference take a look at figure 2-7 of the MCP2122 protocol converter: http://ww1.microchip.com/downloads/en/DeviceDoc/21894c.pdf All of the IrDA SIR Phy. devices I'm familiar with have the IrDA Tx line as active *high* which means that it rests *low*, the XMega is doing the opposite. So that the SIR devices don't see their own transmission, they hold their Rx line high any time Tx is high. This means it is impossible to receive anything, without resorting to screwing with port direction control, which I've not tried yet. I tried using the PORT_INVERT logic, but that doesn't seem to work. I'm guessing that is overridden by the IrCOM module? This is the code where I initialize PORTE for IrCOM. IrCOM is not enabled on any other port. AVR_ENTER_CRITICAL_REGION(); PORTE.DIRSET = PIN3_bm; /* PE3 (TXD0) as output */ PORTE.DIRCLR = PIN2_bm; /* PE2 (RXD0) as input */ PORTE.PIN0CTRL = PORT_INVEN_bm; /* Fix IrCOM Bug? [Doesn't seem to mater if this is here, overridden?] */ PORTB.DIRSET = PIN0_bm; /* PB0 as output */ PORTB.OUTCLR = PIN0_bm; /* PB0 Enable IrDA SD=Low=Active */ /* Disable both RX and TX if already running: */ USARTE0.CTRLB &= (uint8_t) ~(USART_RXEN_bm | USART_TXEN_bm); USART_Baudrate_Set(&USARTE0, 51 , 0); /* Baud Rate 38,400: BSel=51, BScale=0, error %0.16 */ /* USARTE0, 8 Data bits, No Parity, 1 Stop bit: */ USART_Format_Set(&USARTE0, USART_CHSIZE_8BIT_gc, USART_PMODE_DISABLED_gc, false); /* Set USARTE0 in IrDA mode.*/ USART_SetMode(&USARTE0, USART_CMODE_IRDA_gc); ... Have I missed something, or is the XMega IrCOM output improperly inverted? _______________________________________________ AVR-chat mailing list AVR-chat@... http://lists.nongnu.org/mailman/listinfo/avr-chat |
|
|
Re: Anyone used the XMega128A1 IrCOM module? Inverted output?To follow up on this, the output is indeed inverted from what would be
considred normal for IrDA SIR. On Fri, May 22, 2009 at 12:07 PM, Bob Paddock <graceindustries@...> wrote: > Anyone used the XMega128A1 IrCOM module? > > To me it seems that the output state of the module is inverted > from what is normal for driving IrDA transceivers, like > the Vishay TFDU4300. This makes IrDA reception difficult. avr(at)atmel.com wrote: "Hi Bob, The IRCOM module was not specifically developed to support IrDA tranceivers." I find that statement bizarre. Why would you use the IRCOM module anyplace else? "But this is easily accomplished by the invert functionality on the pins that is not overridden by either the USART or the IRCOM. To enable the inverted functionality of the pins, add: PORTE.PIN2CTRL = PORT_INVEN_bm; /* This will invert the RX input. */ PORTE.PIN3CTRL = PORT_INVEN_bm; /* This will invert the TX output to be active low. */" Note that you only want Tx inverted, not Rx, so just add the last one on PIN3, for a IrDA SIR transceiver. I had the wrong pin in my original code to try to get Tx inverted. I suggsted to avr(at)atmel.com that they document the required inversion. _______________________________________________ AVR-chat mailing list AVR-chat@... http://lists.nongnu.org/mailman/listinfo/avr-chat |
| Free embeddable forum powered by Nabble | Forum Help |