1 = Demo Example = 2 3 This example demonstrates UART communication using UART1. Interrupt conditions 4 on the UART peripheral are handled, input is tested, output is produced, and 5 upon receiving the `0` character, DMA-driven output is initiated. 6 7 The DMA-driven output demonstrates mechanisms employed by some of the [[VGA 8 Output Examples|VGA examples]]. A channel is enabled by the interrupt handler 9 and its transfers each initiated by a timer; this should cause text to be 10 transmitted relatively slowly across the serial connection... 11 12 {{{ 13 Hello! 14 }}} 15 16 When this first channel completes all transfers, two other channels chained to 17 it are enabled. Another timer then causes their transfers to be initiated. 18 Since these two channels effectively compete for access to the UART 19 peripheral, their transfers are interleaved. Regardless of the configuration 20 of the example, more text should be transmitted relatively slowly... 21 22 {{{ 23 And once again, hello! 24 }}} 25 26 Although such DMA channel interleaving is rather exotic, other techniques 27 employed by the example are likely to be applicable elsewhere. 28 29 == Hardware Details == 30 31 The pin usage of this solution is documented below. 32 33 === PIC32MX270F256B-50I/SP Pin Assignments === 34 35 {{{ 36 MCLR# 1 \/ 28 37 RA0 2 27 38 RA1 3 26 RB15/U1TX 39 RB0 4 25 RB14 40 RB1 5 24 RB13/U1RX 41 RB2 6 23 42 RB3 7 22 RB11/PGEC2 43 8 21 RB10/PGED2 44 RA2 9 20 45 RA3 10 19 46 RB4 11 18 RB9 47 12 17 RB8 48 13 16 RB7 49 RB5 14 15 50 }}} 51 52 Note that RB6 is not available on pin 15 on this device (it is needed for VBUS 53 unlike the MX170 variant). 54 55 === UART Connections === 56 57 UART1 is exposed by the RB13 and RB15 pins.