Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

UART-hyperterminal interface in verilog code

Hello all,

I am doing my final year BE project on altera's ESDK kit.

I want to interface my PC with that kit via RS-232-Hyperteminal.

I have write code for UART-RX in verilog,load that code in kit,connect RS-232 bet PC & kit but not geting any o/p on kit.

so plz can you help me out in this matter.

here i m attching that verilog code for your reference.

Regards,

sagar

9 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    hi... me too have the same problem...

    can u please help me with the program if u get a solution.

    thank u. my email id is ramasubiah@gmail.com

    thank u.

    --- Quote End ---

    1) check the pin assignments carefully.

    2) check the baud rates
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I think you are trying to do too much at once. Start out with a simple rx/tx uart (rx first, then tx) and then add features to it. We don't even know if you are using an RS232 voltage level convertor properly. Also make sure you write a good testbench and build it as you add functionality. This is the only way to tackle designs, especially one like this which can be broken down easily into multiple independent functions. Look up the spiral approach to software development. set up another PC if you can and just have that PC talk to and fro with hyperterminal by switching tx/rx signals . In this way you can systematically build your application up.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hey... were u able to do serial communication using rs232 succesfully... please can u tell me the exact steps... nd send the verilog code required... please please il b very greatful

    u cn mail me as well ahuja.tapsi at gmail
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    hi,can i know did u success to developing the interface between rs232 and pc?if yes,can u upload the codes for reference?thanx...

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi All,

    --- Quote Start ---

    Try using putty instead of hyperterminal.

    --- Quote End ---

    I have made a nice connection between PuTTY and RS232. It is fine, However, I need to transfer an entier file. How can I do this with PuTTY?

    Please help
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    I am stil having the same problem......

    I cannot connect UART to my HyperTerminal :( . I am trying to use JTAG-to-Avalon Memory Tutorial and see what happens :(

    Thanks
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I am stil having the same problem......

    I cannot connect UART to my HyperTerminal :( . I am trying to use JTAG-to-Avalon Memory Tutorial and see what happens :(

    Thanks

    --- Quote End ---

    Try this code

    /*

    * uart.c

    *

    * Created on: Feb 8, 2013

    * Author: krishnakumar

    */

    # include <stdio.h>

    # include <unistd.h>

    # include "system.h"

    # include "alt_types.h"

    # include "sys/alt_stdio.h"

    # include "pheripheral_comm.h"

    # include "string.h"

    # include "altera_avalon_pio_regs.h"

    # include "altera_avalon_uart.h"

    # include "altera_avalon_uart_regs.h"

    int ReadAddData(int);

    int uart_1(void)

    {

    int Address = 0;

    int Data = 0;

    alt_putstr("Enter Address : ");

    Address = ReadAddData(5);

    if((Address < (int)PIO_0_BASE) || (Address > (int)PIO_0_BASE+0xF))//|| (Address >= PIO_0_BASE-0x50-0x1))

    {

    alt_putstr("Wrong Address for LED\n");

    return 0;

    }

    WRITE_CHAR_TO_HYPERTERMINAL('\n');

    alt_putstr("Enter Data : ");

    Data = ReadAddData(2);

    WRITE_CHAR_TO_HYPERTERMINAL('\n');

    IOWR_ALTERA_AVALON_PIO_DATA(Address, Data);

    return 0 ;

    }