View: 20421|Reply: 14

UART1,2,3c

[Copy link]

3

threads

31

posts

139

credits

Registered member

Rank: 2

credits
139
Published in 2015-6-10 06:03:49 | Show all floors |Read mode
Hello guys,

I am working on a project in which i need to use uart. Can someone tell me how can i use  uart 3 with python on Orange PI 2 .
Thank you!

3

threads

28

posts

151

credits

Registered member

Rank: 2

credits
151
Published in 2015-8-19 14:03:41 | Show all floors
Hi!
I have Orange PI mini 2  H3
tell me how to use UART ?
where lies sys_config.fex ?  (raspbian)  
Thank you!

3

threads

31

posts

139

credits

Registered member

Rank: 2

credits
139
 Author| Published in 2015-6-14 16:29:53 | Show all floors
ah I solved this just they need to be enabled first in sys_config.fex file.

3

threads

31

posts

139

credits

Registered member

Rank: 2

credits
139
 Author| Published in 2015-8-19 16:27:16 | Show all floors
Hello Vladimir,

In sys_config.fex file at line 250+ you should see this:

;----------------------------------------------------------------------------------
;uart configuration
;uart_type ---  2 (2 wire), 4 (4 wire), 8 (8 wire, full function)
;----------------------------------------------------------------------------------
[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       = 4
uart_tx         = portG06<2><1><default><default>
uart_rx         = portG07<2><1><default><default>
uart_rts        = portG08<2><1><default><default>
uart_cts        = portG09<2><1><default><default>

[uart2]
uart_used       = 0
uart_port       = 2
uart_type       = 4
uart_tx         = portA00<2><1><default><default>
uart_rx         = portA01<2><1><default><default>
uart_rts        = portA02<2><1><default><default>
uart_cts        = portA03<2><1><default><default>

[uart3]
uart_used       = 0
uart_port       = 3
uart_type       = 4
uart_tx         = port:PA13<3><1><default><default>
uart_rx         = port:PA14<3><1><default><default>
uart_rts        = port:PA15<3><1><default><default>
uart_cts        = port:PA16<3><1><default><default>

Here "uart_used" must be "uart_used = 1" this enable the UART. Then "uart_type = 4" show you the UART mode (if you use CTS and RTS signals you should use mode 4) for standart uart you dont need CTS and RTS so uart_mode must be " uart_mode = 2" , so the UART part in sys_config.fex should look like this:

;----------------------------------------------------------------------------------
;uart configuration
;uart_type ---  2 (2 wire), 4 (4 wire), 8 (8 wire, full function)
;----------------------------------------------------------------------------------
[uart0]
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>

[uart1]
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>


[uart2]
uart_used       = 1
uart_port       = 2
uart_type       = 2
uart_tx         = port:PA02<2><1><default><default>
uart_rx         = port:PA01<2><1><default><default>



[uart3]
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>

I hope this will help you.

Best regards

.

3

threads

28

posts

151

credits

Registered member

Rank: 2

credits
151
Published in 2015-8-19 23:03:23 | Show all floors
ivan_ucherdjiev replied at 2015-8-19 16:27
Hello Vladimir,

In sys_config.fex file at line 250+ you should see this:

thanks for the answer !
I can not find the file sys_config.fex!
I can not find the file config.txt!
(Raspbian_For_OrangePi2_mini2_v0_8_0)
help...

3

threads

31

posts

139

credits

Registered member

Rank: 2

credits
139
 Author| Published in 2015-8-20 15:43:07 | Show all floors
Hello Vladimir55
1.You should download the linux sorce for opi2 (the sys_config.fex is in this zip).
2.Then you follow this guilde        http://linux-sunxi.org/H3_Manual_build_howto
Which show you how to rebuild your u-boot .
3. Before you build the u-boot you should first make the changes in the sys_config.fex.
4. After rebuilding the u-boot you put it on the sd-card (only the u-boot) and thats it.

In the guide is explaned how to rebuild your you-boot and what you need to do so.

If you have any other questions fill free to ask ;)

Best regards

3

threads

28

posts

151

credits

Registered member

Rank: 2

credits
151
Published in 2015-8-31 16:13:15 | Show all floors
Edited by Vladimir55 at 2015-8-31 16:35
ivan_ucherdjiev replied at 2015-8-20 15:43
Hello Vladimir55
1.You should download the linux sorce for opi2 (the sys_config.fex is in this zip). ...

Hi!
I bought Orange PI in hopes of compatibility for raspberry pi.
(not compatible - deception)
I'm not an expert on building a custom kernel.
There is no possibility other solutions to manage
UART 1-3, USBtoCOM, SPI, i2c, PWM, intrrupt GPIO, intrrupt Time ?
I understand support from the manufacturer will not be just.
if it is true...
then easier to buy raspberi pi2, it all works out of the box.
and forget about Orange PI to operate the equipment.
Thank you.


3

threads

31

posts

139

credits

Registered member

Rank: 2

credits
139
 Author| Published in 2015-9-1 17:17:07 | Show all floors
Hello Vladimir55,

I can build the u_boot with working UARTS for you and send you the BIN file of it . All that you going to need is to put it on the right place in your SDcard.
Uarts and gpios are working, also I think SPI and I2C are working too but I didnt try them yet for the other peripheral I do not know because i didnt test it, but i am sure that someone will make it work if it is not already done.
For Orange Pi a lot more should be done, so you have 2 options join the community and help to make thinks work or just buy raspberry pi. It depends on what you want to do... For me I prefer working with Orange Pi but it's connected with a lot of reading about linux kernel.... If you wish to try to do kernel programing and continue to work with Orange PI I can send you some books which will help you...

Best regards.

2

threads

2

posts

89

credits

Registered member

Rank: 2

credits
89
Published in 2015-10-2 15:22:59 | Show all floors
Edited by alexshi at 2015-10-2 16:06

Hi all!
If you  do it:  (ORANGEPI PC    Ubuntu)
su
modprobe gpio-sunxi
then   GPIO work OK

but

UART1  not work

Why?





3

threads

31

posts

139

credits

Registered member

Rank: 2

credits
139
 Author| Published in 2015-10-9 21:46:28 | Show all floors
Hi mate,

Check do you have ttyS1! If you dont have ttyS1, then its probably, because you need to enable the UART . To enable the uart, you have to rebuild your u-boot.

Best regards
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list