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.

must be set to <strong>on</strong>e. The clock phase determines whe<str<strong>on</strong>g>the</str<strong>on</strong>g>r data are setup <strong>on</strong> <str<strong>on</strong>g>the</str<strong>on</strong>g> leading (first) edge or <str<strong>on</strong>g>the</str<strong>on</strong>g><br />

trailing (last) edge of XCK. The communicati<strong>on</strong> data line always keeps high in idle state.<br />

Figure 3-3. SPI typical data transmissi<strong>on</strong><br />

I d l e<br />

Da t a 7<br />

Da t a 6<br />

Da t a 5<br />

Da t a 4<br />

Da t a 3<br />

Da t a 2<br />

Da t a 1<br />

Da t a 0<br />

I d l e<br />

2. Set c<strong>on</strong>trol register D (CTRLD)<br />

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

– – DECTYPE[1:0] LUTACT[1:0] PECACT[1:0]<br />

Bit 5:4 – DECTYPE[1:0]: Decoding <str<strong>on</strong>g>and</str<strong>on</strong>g> encoding type<br />

Encoding type can c<strong>on</strong>figure LUT (lookup table units) OUT applies during data field <strong>on</strong>ly or during start<br />

<str<strong>on</strong>g>and</str<strong>on</strong>g> data field, or Inverted LUT OUT applies during start field while LUT OUT during data field. The last<br />

type is selected when <str<strong>on</strong>g>Manchester</str<strong>on</strong>g> code start bit is 1 such as DALI.<br />

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

Encoding <strong>on</strong> transmitter engine should be enabled.<br />

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

Transmitter data length should be c<strong>on</strong>trolled by PEC1.<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 />

When calculated BSEL is larger than 0xFFF, Baud Rate generator should be prescaled by 2 BSCALE .<br />

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

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

This 12-bit value c<strong>on</strong>tains <str<strong>on</strong>g>USART</str<strong>on</strong>g> baud rate setting. For equati<strong>on</strong> refer to <str<strong>on</strong>g>the</str<strong>on</strong>g> 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 />

Bit 3 – TXEN: Transmitter 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> Transmitter.<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 />

3.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 />

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 />

6

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

Saved successfully!

Ooh no, something went wrong!