2

Hardware

PHYTEC Mira Board with i.MX6 Processor

Operating System

Yocto Image created using the BSP provided by PHYTECSource with minimal packages in it.

The board has an UART board called UART3 and its software interface within the OS is /dev/ttymxc2 Hardware Manual. The only thing available to check/set serial port on board is stty.

Task

I wish to interface an Adafruit Ultimate GPS to the UART3 to read information from it on the Mira Board.

Attempt-1

I connected both components in the following manner.

UART3_RXD_RS232 (MIRA) --> TX pin (GPS)
UART3_TXD_RS232 (MIRA) --> RX pin (GPS)

Set the serial port as follows:

 stty -F /dev/ttymxc2 speed 9600

Read value:

 cat /dev/ttymxc2

Result: Garbage Values. Tried all possible settings and still obtained garbage values. Wrote a simple node script to try to read the information coming from the port but I got error stating that the characters (garbage values) are not recognized.

Attempt-2

Initially I tried to connect the GPS to a simple Arduino Nano to obtain the values from the GPS and this works, confirming that the GPS sends information and no defect occurred.

I connect the Serial Ports of the Mira and the Arduino and try to send information from the Mira to the Arduino's serial interface and read it through serial console.

setup

   MIRA_Board (serial UART3) ---> Arduino Nano (Serial Pins) --USBCable--> Computer

Pins

 UART3_RXD_RS232 (MIRA) --> RX PIN NANO
 UART3_TXD_RS232 (MIRA) --> TX PIN NANO

I am logged into the Mira board through SSH. The following command is triggered, hoping to expect the same value on the computer's serial console through the Arduino

 echo 'hello' > /dev/ttymxc2

Result: Still Garbage Values on the Console. Result on Putty

The configuration for /dev/ttymxc2 is as

stty -F /dev/ttymxc2 -a                       
speed 9600 baud;stty: /dev/ttymxc2 line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;   -parenb -parodd cs8 hupcl -cstopb cread clocal –crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel -iutf8  
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0   
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke

If this issue is due to serial configuration mismatch, how do I troubleshoot it using stty?

P.S.: Baud rate for GPS should be 9600 which is the case

  • 1
    According to the documents you linked, the Mira board's UART3 uses standard RS-232 signal levels, whereas the GPS module uses 3 V signal levels. These are not compatible, and may even damage the GPS module. – Johan Myréen Apr 27 '18 at 16:56
  • Ah! That could be a strong factor. Are there any GPS modules that do provide 5V outputs? Might look into it. Thanks – Shan-Desai Apr 27 '18 at 16:59
  • You could try using UART1 or UART2 on the Mira board. According to the manual they use TTL level signals. The GPS module outputs 3 V, but tolerates 5 V on input. The +3 V should be enough to be interpreted as a "1" on a TTL input. The RS-232 signals are not suitable without a buffer, because RS-232 specifies +3..+12 V for the space state and -3..-15 V (that's minus 15 V) for the mark state. – Johan Myréen Apr 27 '18 at 17:12
  • Oh My God @JohanMyréen you are a savior. Thank you for figuring it out ! it took me days to solve this issue. Perhaps you can write the above mentioned comment as an answer and i will accept it – Shan-Desai Apr 27 '18 at 17:17
3

You could try using UART1 or UART2 on the Mira board. According to the manual they use TTL level signals. The GPS module outputs 3 V, but tolerates 5 V on input. The +3 V should be enough to be interpreted as a "1" on a TTL input. The RS-232 signals are not suitable without a buffer, because RS-232 specifies +3..+12 V for the space state and -3..-15 V (that's minus 15 V) for the mark state.

| improve this answer | |
  • UART 2 (/dev/ttymxc1) is mainly used for debugging. so I tried connecting the GPS to it. I do get some results but the board restarted. I might have to look into UART1(ttymxc0) but that requires pin muxing and some more software work. – Shan-Desai Apr 27 '18 at 17:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.