13.07.2015 Views

Low Energy UART - AN0017 - Application Note - Energy Micro

Low Energy UART - AN0017 - Application Note - Energy Micro

Low Energy UART - AN0017 - Application Note - Energy Micro

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

3 Software Examples...the world's most energy friendly microcontrollersThe following software examples demonstrates a way to achieve full <strong>UART</strong> communication, using theLE<strong>UART</strong> functionality of the EFM32.3.1 Listening and Receiving in EM2.In this example, LE<strong>UART</strong> communication is initialized using the DMA to transfer received data fromthe LE<strong>UART</strong> receive register to the system memory. When a preconfigure signal frame is received, theLE<strong>UART</strong> generates a interrupt, and the CPU wakes up and writes all the received data from the memoryto the LCD.3.1.1 Example 1: Receiving on DVKThis DVK can receive data both trough RS232, and directly through the pinout on the Prototype Board.This means that the example can be run in a variety of different setups, receiving data both from anotherDVK, a STK or a PC trough the RS232 port on the DVK. The LE<strong>UART</strong>1 RX pin is located on pin J10 onthe DVK Prototype Board, and needs to be connected to the TX pin on the transmitting DVK or STK, ortrough a RS232 cable to a PC. <strong>Note</strong> that the sender and received must have same ground and supplyvoltage when connecting the RX and TX lines directly without using the RS232 port.3.1.2 Example 2: Receiving on STKOn the STK the data can be received trough the pinout located along the rim of the board. The LE<strong>UART</strong>1RX pin is located on the PC7 pin on the bottom row.3.2 Transmitting in EM2.In this example, LE<strong>UART</strong> communication is initialized using the DMA to transfer data from a locationin the local system memory to the LE<strong>UART</strong>, on given RTC(Real Time Clock) interrupts. Every othersecond, the RTC interrupt initializes the DMA to start feeding the LE<strong>UART</strong> TX transmit register with data,and returns to EM2. One of two predefined strings is then transmitted trough the LE<strong>UART</strong> to anyonelistening. The two strings will alternate.3.2.1 Example 3: Transmitting from DVKThe DVK can send data both directly through the pinouts on the Prototype board, and through the RS232port provided. The example can in this way be set up and run in several different setups, both transmittingto another DVK, a STK or a PC. The LE<strong>UART</strong>1 TX pin is located on the pin J9 on the DVK PrototypeBoard, and needs to be connected to the RX pin on any receiving device, or to a PC through the use ofa RS232 cable to a PC. <strong>Note</strong> that the sender and received must have same ground and supply voltagewhen connecting the RX and TX lines directly without using the RS232 port.3.2.2 Example 4: Transmitting from STKOn the STK the data can be transmitted through the pinout located along the rim of the board. TheLE<strong>UART</strong>1 TX pin is located on the PC6 pin on the bottom row.2013-05-08 - an0017_Rev1.07 6 www.energymicro.com

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

Saved successfully!

Ooh no, something went wrong!