(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
[[Category:Explore M3 Bare Metal]]
 
[[Category:Explore M3 Bare Metal]]
In this tutorial we will see how to do serial communication on Explore M3 using ExploreEmbedded libraries.<br>
+
In this tutorial we will see the serial communication on Explore M3 using ExploreEmbedded libraries.<br>
The libraries can be used on different platforms like Keil, ARM GCC, GCC And Eclipse etc.<br><br
+
 
+
 
[[File:0 UART main.gif]]
 
[[File:0 UART main.gif]]
 +
<br><br>
  
 
=Prerequisites=
 
=Prerequisites=
Line 15: Line 14:
  
 
=UART module=
 
=UART module=
Explore M3 has 4-UARTs (UART0-UART3) and hence the interfaces are suffixed with uart number.<br>
+
Explore M3 has 4-UARTs (UART0-UART3) and similarly the interfaces are suffixed with uart number.<br>
 
Below table shows the Explore M3 UART pins.<br>
 
Below table shows the Explore M3 UART pins.<br>
 
{| class="table table-striped table-hover table-condensed table-bordered"
 
{| class="table table-striped table-hover table-condensed table-bordered"
 
|-class="info"
 
|-class="info"
!Port Pin|| Pin Number || PINSEL_FUNC_0 || PINSEL_FUNC_1 ||PINSEL_FUNC_2 ||PINSEL_FUNC_3
+
!UART Channel|| Explore M3 Pin || LPC1768 Pin
 
|-
 
|-
|P0.02 || 98 || GPIO || <b>TXD0</b> || ADC0[7] ||  
+
|RX0 || || P0.3
|-
+
|-       
|P0.03 || 99 || GPIO || <b>RXD0</b> || ADC0[6] ||  
+
|TX0 || || P0.2
|-
+
|-        
|P2_0 || 48 || GPIO || PWM1[1] || <b>TXD1</b> ||
+
|RX1 || 6 || P0.16
|-
+
|-        
|P0.1 || 49 || GPIO || PWM1[2] || <b>RXD1</b> ||
+
|TX1 || || P0.15
|-
+
|-       
|P0.10 || 62 || GPIO || <b>TXD2</b> || SDA2|| MAT3[0]
+
|RX2 || 4 || P0.11
|-
+
|-        
|P0.11 || 63 || GPIO || <b>RXD2</b> || SCL2|| MAT3[1]
+
|TX2 || || P0.10
|-
+
|-        
|P0.0 || 82 || GPIO || CAN1_Rx|| <b>TXD3 </b>|| SDA1
+
|RX3 || || P0.1
|-
+
|-        
|P0.1 || 85 || GPIO || CAN1_Tx|| <b>RXD3</b>  ||  SCL1
+
|TX3 || || P0.0
 
|}
 
|}
<br><br><br><br>
+
 
 +
<br><br><br>
 +
 
 +
=Code=
 +
The below code shows uart communication on all the four UART channels with different baud rate.<br>
 +
*Note:Refer the uart.h file for interface details.
 +
 
 +
<html> 
 +
<script src="https://gist.github.com/SaheblalBagwan/ad6df13a716a376f7a4828cbbe121e7b.js"></script>
 +
</html>

Latest revision as of 18:51, 28 April 2016

In this tutorial we will see the serial communication on Explore M3 using ExploreEmbedded libraries.
0 UART main.gif

Prerequisites

Please check this tutorial for detailed explanation on Lpc1768 inbuilt UART module.
If you are doing it for the first time, then check the below links to setup the project for generating the .bin file.

  1. Keil4 Setup
  2. Keil5 Setup
  3. ARM GCC Setup
  4. Eclipse & ARM GCC Setup



UART module

Explore M3 has 4-UARTs (UART0-UART3) and similarly the interfaces are suffixed with uart number.
Below table shows the Explore M3 UART pins.

UART Channel Explore M3 Pin LPC1768 Pin
RX0 0 P0.3
TX0 1 P0.2
RX1 6 P0.16
TX1 7 P0.15
RX2 4 P0.11
TX2 5 P0.10
RX3 2 P0.1
TX3 3 P0.0




Code

The below code shows uart communication on all the four UART channels with different baud rate.

  • Note:Refer the uart.h file for interface details.