code0610
Posts: 3
Joined: Thu Jul 21, 2016 8:03 am

How to use uart1 (RXD1,TXD1)

Thu Jul 21, 2016 8:56 am

Hi Guys,

I need two UARTs on my raspberry pi compute module.
UART0 (RXD0,TXD0) is used for a terminal connection.
UART1 (RXD1,TXD1) should be used for communication with a device.

So i changed the GPIO Pin 32,33 to RXD1,TXD1 in my dt-blob.bin.
Now i need help how to use it in C++.
There is no new serial device in /dev/.
I read something about a driver i have to compile with the kernel sources.
But the driver i´ve found seems to be not stable or official from raspberrypi.org.
Is there no easy way to use RXD1,TXD1? Why can i configure these pins, when i can´t use it in a easy way?

regards
Sebastian

User avatar
PigeonComputers
Posts: 7
Joined: Fri Apr 29, 2016 7:05 am
Contact: Website

Re: How to use uart1 (RXD1,TXD1)

Thu Jul 21, 2016 5:53 pm

Add to /boot/config.txt

Code: Select all

dtparam=uart1=on
www.pigeoncomputers.com - The Pigeon is a rugged automation controller that runs Linux on a Raspberry Pi Compute Module and offers optoisolated inputs, RS-232, RS-485, CAN, 1-wire, and more.

code0610
Posts: 3
Joined: Thu Jul 21, 2016 8:03 am

Re: How to use uart1 (RXD1,TXD1)

Mon Jul 25, 2016 11:52 am

Hi PigeonComputers,

thanks for your reply.
I added dtparam=uart1=on to the config.txt.
But there is still no new device in /dev/.

huffmania
Posts: 4
Joined: Mon Aug 01, 2016 8:11 pm

Re: How to use uart1 (RXD1,TXD1)

Mon Aug 01, 2016 8:32 pm

I think you want to add this line to your /boot/config.txt (in place of the previous suggestion):

Code: Select all

dtoverlay=uart1,txd1_pin=32,rxd1_pin=33
After rebooting, /dev/ttyS0 should be available.

You may also want to check out this link which has documentation for various overlays:
https://github.com/raspberrypi/linux/tr ... s/overlays. Search for uart1 -- options are documented near the bottom of the page.

code0610
Posts: 3
Joined: Thu Jul 21, 2016 8:03 am

Re: How to use uart1 (RXD1,TXD1)

Fri Aug 05, 2016 9:49 am

It works!! Thank you very much for this hint.

regards
Sebastian

oscargomezf
Posts: 23
Joined: Thu Mar 10, 2016 3:46 pm

Re: How to use uart1 (RXD1,TXD1)

Mon Dec 19, 2016 10:19 am

Hi everyone,

I need two UARTs at the same time too, but I'm working on the raspberry Pi 3B instead of a compute module.
Do you know if I can try the same on a Raspberry Pi 3?

Best regards.

User avatar
joan
Posts: 12745
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: How to use uart1 (RXD1,TXD1)

Mon Dec 19, 2016 11:54 am

oscargomezf wrote:Hi everyone,

I need two UARTs at the same time too, but I'm working on the raspberry Pi 3B instead of a compute module.
Do you know if I can try the same on a Raspberry Pi 3?

Best regards.
Yes, you can try the same.

No, it will not work. The GPIO you need are not accessible on the Pi 3.

Return to “Compute Module”

Who is online

Users browsing this forum: No registered users and 5 guests