View: 18590|Reply: 12

Multiple UART

[Copy link]

3

threads

10

posts

111

credits

Registered member

Rank: 2

credits
111
Published in 2016-6-21 20:51:20 | Show all floors |Read mode
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

3

threads

10

posts

111

credits

Registered member

Rank: 2

credits
111
 Author| Published in 2016-6-30 03:57:19 | Show all floors
was a mux issue uart0 for console and all other for serial


[uart0]
uart_used       = 1
uart_port       = 0
uart_type       = 2
uart_tx         = portA04<2><1><default><default>
uart_rx         = portA05<2><1><default><default>


[uart1]
uart_used       = 1
uart_port       = 1
uart_type       = 2
uart_tx         = portG06<2><1><default><default>
uart_rx         = portG07<2><1><default><default>

[uart2]
uart_used       = 1
uart_port       = 2
uart_type       = 2
uart_tx         = portA00<2><1><default><default>
uart_rx         = portA01<2><1><default><default>


[uart3]
uart_used       = 1
uart_port       = 3
uart_type       = 2
uart_tx         = portA13<3><1><default><default>
uart_rx         = portA14<3><1><default><default>

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-6-30 06:47:58 | Show all floors
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
                         |       |                             |       |



3

threads

10

posts

111

credits

Registered member

Rank: 2

credits
111
 Author| Published in 2016-6-30 22:46:52 | Show all floors
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)

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-7-4 06:56:09 | Show all floors
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.p ... l=%2Borange+%2Buart


10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-7-5 20:28:22 | Show all floors
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

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-7-6 06:56:11 | Show all floors
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


10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-7-6 06:58:46 | Show all floors
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

10

threads

218

posts

2040

credits

Gold member

Rank: 6Rank: 6

credits
2040
Published in 2016-7-6 22:18:55 | Show all floors
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

3

threads

10

posts

111

credits

Registered member

Rank: 2

credits
111
 Author| Published in 2016-7-7 02:31:12 | Show all floors
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
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list