bigmac post at 2016-6-21 20:51:20

Multiple UART

Hi on our Orange Pi Plus 2 computers, tuning fex and using loboris debian jessie we get all 4 uart ports (confugured 2 for Tx/Rx) and we've tested all and works individually, but they can run 2 serial ports at the same time: i.e. using a GPS in ttyS1 and using a second GPS in ttyS2, just work the first one and the second did not work. If you reboot and use S1 then S2 up to S4 it works on each port. Other issue is that we use a USB serial dongle (USB TTL) and works perfect with both (onboard ttyS1 and ttyUSB0 for example)
There's some misconifguration or kernel patch that we may need to apply in order to use both onboard serial ports (we need 2 of them) any help will be appreciated!
Regards
Cristian

bigmac post at 2016-6-30 03:57:19

was a mux issue :D uart0 for console and all other for serial



uart_used       = 1
uart_port       = 0
uart_type       = 2
uart_tx         = port:PA04<2><1><default><default>
uart_rx         = port:PA05<2><1><default><default>



uart_used       = 1
uart_port       = 1
uart_type       = 2
uart_tx         = port:PG06<2><1><default><default>
uart_rx         = port:PG07<2><1><default><default>


uart_used       = 1
uart_port       = 2
uart_type       = 2
uart_tx         = port:PA00<2><1><default><default>
uart_rx         = port:PA01<2><1><default><default>



uart_used       = 1
uart_port       = 3
uart_type       = 2
uart_tx         = port:PA13<3><1><default><default>
uart_rx         = port:PA14<3><1><default><default>

nopnop2002 post at 2016-6-30 06:47:58

When there is no kernel patch, there is 2 substitution plans.

CD4052B MULTIPLEXER

     +------------------+
                  | OPI                |
                  |                     |
               +------------------+
                     Tx|       |Rx
                      |       |
  Tx4  +------------------+    Tx3
      --------| CD4052B      |-------
      --------|                     |-------
      Rx4   +------------------+    Rx3
               Tx1| |Rx1 Tx2| |Rx2
                     | |            | |


i2c+ATtiny2313(4313)
ATtiny has to use it by 3.3V.

     +------------------+
                  | OPI               |
                  | i2c MASTER   |
                  +------------------+
                         i2c|
                            +-------------------------------+
                            |                                       |
       +------------------+           +------------------+
               | ATtiny2313   |            | ATtiny2313      |
               | i2c SLAVE      |            | i2c SLAVE      |
               +------------------+             +------------------+
                     Tx|       |Rx                     Tx|       |Rx
                         |       |                           |       |



bigmac post at 2016-6-30 22:46:52

thanks! can enable pins 38&40 as ttyS1, pins 8&10 as ttyS2, pins 3&5 as ttyS3 (if you don't use i2c on those pins and use 27&28 pins insted) and 11&13 as ttyS4 keeping the 3 pins as console on uart0 (ttyS0)

nopnop2002 post at 2016-7-4 06:56:09

Ashtonites replied at 2016-7-3 20:49
I am new to Orange Pi, so pardon my stupid questions.
I have an Orange Pi PC, downloaded Raspbian an ...

Please use this OS.
Armbian_5.14_Orangepipc_Debian_jessie_3.4.112

And please follow this.
http://forum.armbian.com/index.php/topic/1524-orange-pi-one-how-to-enable-uart/?hl=%2Borange+%2Buart


nopnop2002 post at 2016-7-5 20:28:22

Edited by nopnop2002 at 2016-7-5 20:31

Ashtonites replied at 2016-7-5 11:54
By the way, if I try to follow the instructions for downloading WiringOP in http://www.orangepi.org/ ...


git clone https://github.com/zhaolei/WiringOP.git -b h3

cd WiringOP/

sudo ./build

nopnop2002 post at 2016-7-6 06:56:11

I confirmed that it can be received in 2 of UART at the same time using in separate process.
2 of uart may not be able to use it in single process at the same time.

The OS I use is below.
Armbian_5.13_Orangepione_Debian_jessie_3.4.112


nopnop2002 post at 2016-7-6 06:58:46

I confirmed that it can be received in 2 of UART at the same time using in separate process.
2 of uart may not be able to use it in single process at the same time.

The OS I use is below.
Armbian_5.13_Orangepione_Debian_jessie_3.4.112

nopnop2002 post at 2016-7-6 22:18:55

Ashtonites replied at 2016-7-6 11:48
Thanks for your help nopnop2002, but the story isn't over yet, I'm afraid.
I typed what you said, ex ...
Link is same as RPI.
cc -o hoge hoge.c -lwiringPi

bigmac post at 2016-7-7 02:31:12

Wow I've not seen that baudrate before!
First check your fex in order to set the needed uart(s) and kind of (2,4 or 8) then try setting the speed by stty -F /dev/ttyS1 (or 2 or 3) space baudrate i.e 9600 (or the needed baudrate allowed by the board (i've tried up to 115200, not sure about the one you specify)

stty -F /dev/ttyS1 96000 to get 9600 bauds 1n8 on uart 1 (ttyS1)

Hope it works for you
page: [1] 2
View full version: Multiple UART