Microchip | The Embedded Control Solutions Company Register Login
Browse All
Microchip Technology
 369 Code Snippets

CE214 - UART Loop-back-1

Microchip Technology

In this code examples, 256-byte transmit buffer is tranmitted using UART and received back in receive buffer. This operation happens contineously.

About this Code Example


In this code examples, 256-byte transmit buffer is tranmitted using UART and received back in
receive buffer. This operation happens contineously.


void cfgUart1(void)
This function configures UART in loop-back mode with following settings viz., 8-data bits, 1-stop
bit and no parity.

void initUartBuff(void)
This function pre-initialise the transmit data buffer and DMA RAM buffer for transmission

void cfgDma0UartTx(void)
This function configures DMA channel 0 for UART transmission. DMA is configured in ping-pong mode
with auto increment addressing for DMA memory read.

void cfgDma1UartRx(void)
This function configures DMA channel 0 for UART reception. DMA is configured in ping-pong mode
with auto increment addressing for DMA memory write.

void __attribute__((__interrupt__)) _DMA0Interrupt(void)
This interrupt routine handles the transmit ping-pong buffer.

void __attribute__((__interrupt__)) _DMA1Interrupt(void)
This interrupt routine handles the receive ping-pong buffer.

Categories

Release History

  • Jun 20, 2012

    Version: 1.0.0

    First Release to ECS

Download Contact the Developer

*Required Fields


  • Current Version:1.0.0
  • Created:Jun 20, 2012
  • Updated:Feb 26, 2015
  • Downloads:5158
  • MPLAB Version:V8.xx or above
  • C Compiler:MCC18 v3.30 or above
  • Development Tools:Explorer 16 Demo board
  • Supported Devices:PIC24HJ256GP610

Corporate News

Resources

Stay Connected

Stay up to date with the latest news from Microchip Technology.