Serial console

From Qi-Hardware
Jump to: navigation, search

At the back of the Ben NanoNote, there are GND, TXD, and RXD pins, which you can use for a serial console to the device.

To get output from those pins you need a TTL <-> RS232 converter (such as the FTDI TTL-232R-3V3 USB-to-TTL cable) which This version of FTDI's USB to TTL serial adapter cables has it's I/O pins configured to operate at 3.3V levels. This means also that the Ben NanoNote serial console works at typical 3.3V level. So DO NOT use a 5.0V levels converter.

Contents

[edit] Pinout

See also here. If you want to know that how to soldering these test points, you can also see here.

[edit] Connection

  • Connect GND on the NanoNote to GND on your TTL-to-RS232 converter.
  • Connect TXD on the NanoNote to RXD on your TTL-to-RS232 converter.
  • Connect RXD on the NanoNote to TXD on your TTL-to-RS232 converter.

[edit] Software

  • The default Baud rate is 57600, 8n1, no hardware or software flow control.
  • You can use any terminal program on the PC side, such as minicom. You can use minicom with the following sample config file:
$ cat /etc/minicom/minirc.qi
pu port             /dev/ttyUSB0
pu baudrate         57600
pu rtscts           No
$ minicom -o qi

[edit] The RXD wire

The RX serial data channel can be set in the CPU to GPIO mode or to alternative function (serial RX). By default, it's set to GPIO, as a keyboard line uses this (pin 26 of GPIO port D) HW wiki.

To enable the alternative function (RX), and disable the keyboard use, we have to write '1' to the proper position (so, the 32-bit value 2^26=0x04000000) of the PDFUNS register (0x10010344). I took this from the jz4725 PM, which in this aspect works like the jz4740 in the nanonote.

We can set the value using the poke command running it as:

poke -32 0x10010344 0x04000000

To test that it works, you can run:

$ stty -F /dev/ttyS0 57600 raw
$ while true; do echo bon dia; done > /dev/ttyS0 &
$ cat ttyS0

And cross the TX and RX wires. cat should be printing lines saying "bon dia".

[edit] Hardware mod to have a pluggable serial port

TP5 -- TXD
TP4 -- RXD

[edit] Less invasive (and less robust) approach

Personal tools
Namespaces
Variants
Actions
Navigation
interactive
Toolbox
Print/export