Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: UART 16550 vs standard UART

Hybrid View

  1. #1
    Join Date
    Nov 2016
    Posts
    12
    Rep Power
    1

    Default UART 16550 vs standard UART

    Hi all,
    is there a simple way of replacing the standard UART, which is in all examples, with the UART16550?
    I mean, that simply all stdin/stdout/stderr goes to the UART16550?
    I can only have one UART in the system, and would remove then the standard UART ...
    Thanks!

  2. #2
    Join Date
    Nov 2016
    Posts
    12
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Hi all,
    just tried to get the 16550 UART to work at all, but no output so far. I tried to implement, what is in the the "ug_embedded_ip" manual, but so far no luck.
    Is there anything obvious missing, or wrong:

    #include <stdio.h>
    #include <stdlib.h>
    #include <sys/ioctl.h>
    #include <sys/termios.h>
    #include <fcntl.h>
    #include <string.h>
    #include <unistd.h>
    #include <sys/time.h>
    #include <time.h>
    #include "system.h"
    #include "altera_16550_uart.h"
    #include "altera_16550_uart_regs.h"

    #define BUFSIZE 512
    char TXMessage[BUFSIZE] = "Hello World, UART16550 sending\n";

    int UARTDefaultConfig(UartConfig *Config)
    {
    Config->stop_bit = STOPB_1;
    Config->parity_bit = NO_PARITY;
    Config->data_bit = CS_8;
    Config->baudrate = BR115200;
    Config->fifo_mode = 0;
    Config->hwfc = 0;
    Config->rx_fifo_level= RXFULL;
    Config->tx_fifo_level= TXEMPTY;
    return 0;
    }
    int UARTBaudRateTest()
    {
    UartConfig *UART0_Config = malloc(1*sizeof(UartConfig));
    altera_16550_uart_state* uart_0;

    uart_0 = altera_16550_uart_open ("/dev/a_16550_uart_0");
    UARTDefaultConfig(UART0_Config);
    altera_16550_uart_write(uart_0, &TXMessage, strlen(TXMessage), 0);
    usleep(1000);
    free(UART0_Config);
    return (0);
    }

    int main()
    {
    int result=0;
    result = UARTBaudRateTest();
    }

    Thanks!

  3. #3
    Join Date
    Feb 2016
    Posts
    33
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Hi,

    What you mean by replacing the standard UART?
    How about changing the BSP settings (stdin, stdout, stderr) to 16550 UART?
    Are you trying to printf output through 16550 UART IP instead of RS232 UART IP?

  4. #4
    Join Date
    Nov 2016
    Posts
    12
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Quote Originally Posted by aaronchng View Post
    Hi,

    What you mean by replacing the standard UART?
    yes!
    Quote Originally Posted by aaronchng View Post
    How about changing the BSP settings (stdin, stdout, stderr) to 16550 UART?
    Are you trying to printf output through 16550 UART IP instead of RS232 UART IP?
    Exactly. I saw in another post, that you should be able to simply replace the "uart0" in the BSP_HAL editor,
    but in the setttings HAL/Common stdin/stdout/stderr, the only entry is "none" and the a_16550_uart_0 can't be selected.

    Do I have to rename the instance of "a_16550_uart_0" to "uart_0" in qsys?

    Thanks!

  5. #5
    Join Date
    Apr 2014
    Posts
    33
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    I had a look at using the 16550 UART. In the end I found it much easier to use this one:-
    http://www.alterawiki.com/wiki/FIFOed_Avalon_Uart

    It is exactly the same to use as the standard Altera UART but offers buffering, higher speed, RS485 driver enable + lots more. Well worth a look.

  6. #6
    Join Date
    Feb 2016
    Posts
    33
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Hi,

    I suspect you observed "none" in the settings due to the Qsys generated files are not refreshed/synced with your SBT.
    Try reload the .sopcinfo file and create new BSP. You do not have to rename as the settings should reflect the name in Qsys.

  7. #7
    Join Date
    Nov 2016
    Posts
    12
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Quote Originally Posted by aaronchng View Post
    Hi,

    I suspect you observed "none" in the settings due to the Qsys generated files are not refreshed/synced with your SBT.
    Try reload the .sopcinfo file and create new BSP. You do not have to rename as the settings should reflect the name in Qsys.
    I tried that too, and the 16550_uart doesn't show

  8. #8
    Join Date
    Feb 2016
    Posts
    33
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Did you export those UART signals in Qsys?

  9. #9
    Join Date
    Nov 2016
    Posts
    12
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Quote Originally Posted by aaronchng View Post
    Did you export those UART signals in Qsys?
    Yes, they also show up in the .bdf file and are connected there ...

  10. #10
    Join Date
    Feb 2016
    Posts
    33
    Rep Power
    1

    Default Re: UART 16550 vs standard UART

    Have you tried if JTAG UART works?

Similar Threads

  1. Replies: 3
    Last Post: August 26th, 2015, 11:25 AM
  2. 16550 UART to Avalon
    By alterahenry in forum General Altera Discussion
    Replies: 11
    Last Post: January 9th, 2011, 10:47 PM
  3. Replies: 2
    Last Post: May 30th, 2008, 12:03 AM
  4. drivers for opencores 16550 Uart
    By mountain8848 in forum Linux Forum
    Replies: 0
    Last Post: December 20th, 2005, 02:13 AM
  5. UART 16550 from OpenCores
    By VLorenzo in forum General Discussion Forum
    Replies: 1
    Last Post: November 14th, 2005, 11:54 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •