Forum Discussion

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

uart RS232 communication problem

Hi all,

I have cyclone2 dev kit. I tried running uart program given in the Embedded Peripherals pdf but there is no output on the hyperterminal. I have set the baud rate to 9600 and i have changed it in the system.h also. But the program is neither taking any input from hyperterminal nor sending any output. What could be the solution for this? Do I need to modify the code?

Even this simple code is not working!

int main (void)

{

char* msg = "hello world";

FILE* fp;

fp = fopen ("/dev/uart_0", "w");

if (fp!=NULL)

{

fprintf(fp, "%s",msg);

fclose (fp);

}

return 0;

}

Thanks,

Nishant

8 Replies

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

    Have you tried simulation? Is it something like it is working fine in simulation but not in the practical case.

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

    No, I tried running the program on simulator but it doesn't run there either. May be it needs some hardware support to run.

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

    simulator doesn't need any hardware support.

    if it doesn't run in simulator , doesn't take i/ps and o/ps there is something absolutely wrong in the way in which you incorporated your UART in the VHDL/verilog project.

    if the QUARTUSII isn't giving any kind of errors while compiling your project, atleast you can check the warnings to get an idea.

    I think it is something basic that you are missing out here
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the directions. I get these warnings when I try run in Instruction Set Simulator. Do I need use SOPC builder to correct these.

    Please guide me further. Thanks.

    Warning : SOPC Builder system component led_red is not supported by the simulato

    r. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component led_green is not supported by the simula

    tor. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component button_pio is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component switch_pio is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component SEG7_Display is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component sram_0 is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component Audio_0 is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component SD_DAT is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component SD_CMD is not supported by the simulator. Simulation may be incorrect if your software attempts to access it

    Warning : SOPC Builder system component SD_CLK is not supported by the simulator. Simulation may be incorrect if your software attempts to access it
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    What is QUARTUSII project? What is the file extension? and what do I need to do to modify it?

    Thanks for the reply!
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    The warning says The simulator cannot simulate buttons, LEDs, and other physical things. You can ignore these messages.

    have you set the startup type to ROMRAM
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Actually I am able to run other programs like using jtag_uart_0 but the proble is with using uart.

    Whare to set startup type to ROMRAM?

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

    when i run the program on DE2 to do the ETHERNET test ,I also meet these warnings . NOw i havn't run a program in DE2_demonstrations .