SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C question

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

abomin3v3l
Posts: 7
Joined: Wed Jan 21, 2015 8:15 pm

SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C question

Wed Jan 21, 2015 8:58 pm

*************** UART/USART QUESTION ***************

I'll need 7 UARTS for my current design.
The portfolio below shows that SAMA5D35 has 7 UARTS (I'll need only one UART of these with flow control through RTS/CTS).
http://www.atmel.com/Images/6280Q-ARM-C ... 011315.pdf

But in SAMA5D3 series' datasheet:
http://www.atmel.com/Images/Atmel-11121 ... asheet.pdf

Looking at the pinout pages from 11 to 18, I found the pins for just 6 UART/USART ports. Where is the 7th port pins?
URXD0/UTXD0 (page 13)
URXD1/UTXD1 (page 11)
RXD0/TXD0 (page 13)
RXD1/TXD1 (page 12)
RXD2/TXD2 (page 14)
RXD3/TXD3 (page 14)

Also, looking at page 1352 is shown UART0 and UART1 ports, and at page 1372 is shown USART0, USART1, USART2 and USART3 ports, totaling just 6 serial ports. Where is the 7th port?

*************** SPI1/I2C1 SHARED PINS QUESTION ***************

I'll run Linux on a SAMA5D35 and I want to connect only a microSD card to SPI1 using only one chip select pin (SPI1_NPCS0), and at the same time, I also want to use the I2C1 port (pins TWD1 and TWCK1) to communicate with a device.
Is this possible? Since the I2C1 pins (TWD1 and TWCK1) are shared with other SPI chip select pins that won't be used in my design (SPI1_NPCS1 and SPI1_NPCS2).

http://imagizer.imageshack.us/a/img661/8204/0SjlGT.png
blue_z
Location: USA
Posts: 1954
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Thu Jan 22, 2015 11:16 am

abomin3v3l wrote:But in SAMA5D3 series' datasheet: ... Where is the 7th port pins?
Page 2 of the datasheet has the salient information. The Feature list mentions seven serial communication devices:

Code: Select all

 Four USARTs, two UARTs, one DBGU
You're overlooking the DBGU port.
abomin3v3l wrote:I want to connect only a microSD card to SPI1 using only one chip select pin (SPI1_NPCS0), and at the same time, I also want to use the I2C1 port (pins TWD1 and TWCK1) to communicate with a device.
Is this possible?
Yes, that's acceptable assuming that the Device Tree properly reflects the configuration.

Regards
abomin3v3l
Posts: 7
Joined: Wed Jan 21, 2015 8:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Thu Jan 22, 2015 2:25 pm

@blue_z: Thanks.

Do you know if its possible to use the DBGU as a normal UART? In order I can have 7 normal UARTs in the PCB design? I was reading the datasheet in DBGU section (43) and didn't come to a conclusion if that's possible.

I saw that the DBGU can be configured to disable the parity bit, theres a flag that indicates there's data available, and the RX and TX registers and that "Both the receiver and the transmitter of the UART are connected to a DMA Controller (DMAC) channel."

I really need 7 UARTs in my design, with just 6 the things would get complicated.
blue_z
Location: USA
Posts: 1954
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Fri Jan 23, 2015 3:11 am

abomin3v3l wrote:Do you know if its possible to use the DBGU as a normal UART? In order I can have 7 normal UARTs in the PCB design?
Functionally the DBGU is programmed just like a UART. (Perhaps the clock initialization is different.)  In fact all of the USART, UART and DBGU ports use the same Linux device driver (for standard TTY serial port functionality); it's just that some ports do not have HW flow-control and/or modem-control lines.
abomin3v3l wrote:I really need 7 UARTs in my design, with just 6 the things would get complicated.
For HW functionality, it's possible to configure the SoC for seven UARTs.  
Operationally it gets complicated.  
After a reset, a "RomBOOT" text string is always output on the DBGU port at 115200 baud, 8N1.  If the other end is configured for a different baud rate, then this should be received as bad input and tossed (assuming that there's a robust handler).
You'll have to modify AT91Bootstrap and U-Boot (or whatever you use for bootstrap/bootloading) to not use the DBGU port and run "quiet"ly.  
The Linux command line can easily be edited to change/remove the "console=..." parameter.  The kernel decompression code will need some attention.  Edit the startup file to not run getty on any serial port.

Or if you run a binary protocol on that serial link, let the console text spew forth, and make sure the receiving end is robust and will ignore the text.

Regards
abomin3v3l
Posts: 7
Joined: Wed Jan 21, 2015 8:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Fri Jan 23, 2015 6:31 pm

@blue_z: Thanks

Well, if the DBGU may be used as a normal UART then the SAMA5D35 will fit my design needs (7 UARTs).

In principle, the serial link connected to DBGU will be for future use (but certainly it will be used). Probably it will run at 9600bps, but I saw there's a register (DBGU_BRGR) to modify the DBGU baudrate. 

The system will have bootloader for apps through GPRS module, so I think before start any coding, the AT91Bootstrap and U-Boot need to be modified as you said (to not use the DBGU port and run quietly, to not send byte strings on the DBGU by itself). That's the best thing to do to avoid problems, right? 

@awneil: just because the product is very cost sensitive and pcb-size sensitive

Regards
abomin3v3l
Posts: 7
Joined: Wed Jan 21, 2015 8:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Mon Jan 26, 2015 8:01 pm

blue_z wrote:After a reset, a "RomBOOT" text string is always output on the DBGU port at 115200 baud, 8N1.  If the other end is configured for a different baud rate, then this should be received as bad input and tossed (assuming that there's a robust handler).
My last question, do you know if its possible to change the baudrate of DBGU to 9600bps through Linux drivers? 
And if I can configure the UARTs to a non-usual baudrate, like 10400bps? (this question apply to all serial ports)
Regards. 
blue_z
Location: USA
Posts: 1954
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Mon Jan 26, 2015 9:48 pm

abomin3v3l wrote:if its possible to change the baudrate of DBGU to 9600bps through Linux drivers?
Yes, use the termios interface or the stty command.
abomin3v3l wrote:And if I can configure the UARTs to a non-usual baudrate, like 10400bps? (this question apply to all serial ports)
You might get close enough to that baud rate if you choose the appropriate clock divisor. Note that the USART also has an external clock capability.
Refer to the "Baud Rate Generator" sections in the datasheet.

Regards
abomin3v3l
Posts: 7
Joined: Wed Jan 21, 2015 8:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Mon Jan 26, 2015 10:48 pm

Thanks blue_z
blue_z wrote:You might get close enough to that baud rate if you choose the appropriate clock divisor. Note that the USART also has an external clock capability.
Refer to the "Baud Rate Generator" sections in the datasheet.
I forgot to say: the doubt is if a UART can be set to 10400bps or 20800bps (for example) under Linux (or if Linux accepts only default baudrates like 9600,19200,38400,57600,115200bps etc).
Regards.
blue_z
Location: USA
Posts: 1954
Joined: Thu Apr 19, 2007 10:15 pm

Re: SAMA5D35: it has 6 or 7 UARTs? + shared SPI/I2C questio

Tue Jan 27, 2015 1:41 am

abomin3v3l wrote:the doubt is if a UART can be set to 10400bps or 20800bps (for example) under Linux
Don't know what will work with atmel_serial.c. You can try the techniques mentioned here:
http://stackoverflow.com/questions/1944 ... e-on-linux
http://stackoverflow.com/questions/1264 ... e-on-linux

Regards

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 2 guests