28.02.2014 Views

Manchester Transceiver Using the USART and XCL Modules on ...

Manchester Transceiver Using the USART and XCL Modules on ...

Manchester Transceiver Using the USART and XCL Modules on ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Bit 3:2 – LUTACT[1:0]: LUT Acti<strong>on</strong><br />

Bit 1:0 – PECACT[1:0]: Peripheral Counter Acti<strong>on</strong><br />

Receiver data length should be c<strong>on</strong>trolled by PEC0.<br />

3. Set baud rate c<strong>on</strong>trol register (BAUDCTRLA BAUDCTRLB)<br />

7 6 5 4 3 2 1 0<br />

BSCALE[3:0]<br />

BSEL[11:8]<br />

7 6 5 4 3 2 1 0<br />

BSEL[7:0]<br />

Bit 7:4 – BSCALE[3:0]: Baud Rate Scale Factor<br />

Bit 3:0 – BSEL[11:8]: Baud Rate Bits<br />

Bit 7:0 – BSEL[7:0]: Baud Rate Bits<br />

To calculate asynchr<strong>on</strong>ous baud rate setting, refer to <str<strong>on</strong>g>the</str<strong>on</strong>g> equati<strong>on</strong> in datasheet.<br />

4. Set c<strong>on</strong>trol register B (CTRLB)<br />

7 6 5 4 3 2 1 0<br />

ONEWIRE SFDEN – RXEN TXEN CLK2X MPCM TXB8<br />

Bit 7 – ONEWIRE: One-Wire C<strong>on</strong>figurati<strong>on</strong> Enabled<br />

Bit 6 – SFDEN: Start Frame Detecti<strong>on</strong> Enable<br />

Bit 4 – RXEN: Receiver Enable<br />

Setting to 1 enables <str<strong>on</strong>g>the</str<strong>on</strong>g> <str<strong>on</strong>g>USART</str<strong>on</strong>g> Receiver.<br />

Bit 3 – TXEN: Transmitter Enable<br />

Bit 2 – CLK2X: Double Transmissi<strong>on</strong> Speed<br />

Bit 1 – MPCM: Multi-processor Communicati<strong>on</strong> Mode<br />

Bit 0 – TXB8: Transmit Bit<br />

4.2 How to c<strong>on</strong>figure <str<strong>on</strong>g>XCL</str<strong>on</strong>g><br />

1. Set c<strong>on</strong>trol register A (CTRLA)<br />

7 6 5 4 3 2 1 0<br />

LUT0OUTEN[1:0] PORTSEL[1:0] – LUTCONF[2:0]<br />

Bit 7:6 – LUT0OUTEN[1:0]: LUT0 Output Enable<br />

Bit 5:4 – PORTSEL[1:0]: Port Selecti<strong>on</strong><br />

Select <str<strong>on</strong>g>the</str<strong>on</strong>g> corresp<strong>on</strong>ding <str<strong>on</strong>g>USART</str<strong>on</strong>g> used with PEC.<br />

Bit 2:0 – LUTCONF[2:0]: LUT C<strong>on</strong>figurati<strong>on</strong><br />

2. Set c<strong>on</strong>trol register E (CTRLE)<br />

7 6 5 4 3 2 1 0<br />

CMDSEL TCSEL[2:0] CLKSEL[3:0]<br />

Bit 7 – CMDSEL: Comm<str<strong>on</strong>g>and</str<strong>on</strong>g> Selecti<strong>on</strong><br />

Bit 6:4 – TCSEL[2:0]: Timer/Counter Selecti<strong>on</strong><br />

PEC0 should be selected for <str<strong>on</strong>g>USART</str<strong>on</strong>g> receiver.<br />

3. Set peripheral length c<strong>on</strong>trol register (PLC)<br />

7 6 5 4 3 2 1 0<br />

PLC[7:0]<br />

Bit 7:0 – PLC[7:0]: Peripheral Length C<strong>on</strong>trol Bits<br />

Set <str<strong>on</strong>g>the</str<strong>on</strong>g> length as <str<strong>on</strong>g>the</str<strong>on</strong>g> <str<strong>on</strong>g>USART</str<strong>on</strong>g> receiver data length subtracts 1.<br />

Atmel AT03335: <str<strong>on</strong>g>Manchester</str<strong>on</strong>g> <str<strong>on</strong>g>Transceiver</str<strong>on</strong>g> <str<strong>on</strong>g>Using</str<strong>on</strong>g> <str<strong>on</strong>g>the</str<strong>on</strong>g> <str<strong>on</strong>g>USART</str<strong>on</strong>g> <str<strong>on</strong>g>and</str<strong>on</strong>g> <str<strong>on</strong>g>XCL</str<strong>on</strong>g> <str<strong>on</strong>g>Modules</str<strong>on</strong>g> <strong>on</strong> XMEGA E [APPLICATION NOTE]<br />

42164A−AVR−07/2013<br />

10

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!