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 [email protected] http://lists.nongnu.org/mailman/listinfo/avr-chat
