aboutsummaryrefslogtreecommitdiffstats
path: root/source/usart.rst
blob: fa9c55c050f7d2362a51492ffb42551a67cd272f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
.. _usart:

USART
=====

A USART is more commonly known a *serial port*.  It's used to transmit
information between Maple and another device (like your computer,
another Maple, etc.).

.. contents:: Contents
   :local:

.. _usart-circuit:

Hardware/Circuit Design
-----------------------

To use a serial port to communicate with an external serial device,
connect the TX pin to your device's RX pin, the RX to your device's TX
pin, and your Maple board's ground to your device's ground.

.. warning:: Don't connect these pins directly to an RS232 serial
   port; they operate at +/- 12V and can damage your board.

.. TODO [0.0.12/Maple Native] UART4 and UART5, Native links

Each LeafLabs board has at least 3 separate USART devices. In the most
simple use case, the RX and TX pins are used to send data at a
predetermined speed (or *baud rate*).  Their usage is documented in
the :ref:`Serial Ports <lang-serial>` language reference page.

Which pins correspond to the USART TX and RX pins are given on your
board's silkscreen, and also in the board-specific USART pin maps
available here:

* :ref:`Maple <maple-usart-map>`
* :ref:`Maple RET6 Edition <maple-ret6-usart-map>`
* :ref:`Maple Mini <maple-mini-usart-map>`

If you use a particular serial port, you cannot also use its
communication pins for other purposes at the same time.

Compatible Devices and Specifications
-------------------------------------

We have successfully used the USART ports with an FT232R-based
USB-serial converter at up to 115200 baud.  Higher speeds should
certainly be possible.

Recommended Reading
-------------------

* `Wikipedia article on Universal Asynchronous Receiver/Transmitter
  (USART)
  <http://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter>`_
* `Arduino Serial reference
  <http://arduino.cc/en/Reference/Serial>`_
* ST `Reference Manual RM0008
  <http://www.st.com/stonline/products/literature/rm/13902.pdf>`_
  (PDF), Chapter 27.
* `Serial and UART Tutorial
  <http://www.freebsd.org/doc/en/articles/serial-uart/>`_ (written for
  FreeBSD, but contains a large amount of general information).