Forum Discussion

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

nios UART RS232 Interrupt Mode settings

Hi,

I'm using in nios the RS232 UART made from the sopc.

I understand(maybe I'm wrong) that it has two modes: Polling and Interrupt.

In the Interrupt mode a driver should run automatically and store the data received in a circular way.

I unchecked the "small C library" and the "reduced driver" from the BSP editor and still I can't recieve data more that one byte.

For example, if I send to the uart "abcd" I will be able to read only "d", as if the driver is not working, or the Interrupt mode is not intialized.

Does anyone know what additional settings I have to change in order for that mode to operate?

Or what things do I have to if exist, maybe I'm missing some files or something like that.

I tried to write to the uart more than 1 byte and it succeded.

Thanks,

Merabi

4 Replies

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

    Hi,

    --- Quote Start ---

    I understand(maybe I'm wrong) that it has two modes: Polling and Interrupt.

    --- Quote End ---

    You are right.

    In polling mode, you have to read sometimes.

    In interrupt mode, your interrupt routine handles the received character.

    --- Quote Start ---

    In the Interrupt mode a driver should run automatically and store the data received in a circular way.

    --- Quote End ---

    Wrong, it only store ONE character (7 or 8 bits)

    --- Quote Start ---

    I tried to write to the uart more than 1 byte[...]

    --- Quote End ---

    I have employ FIFOed UART from http://www.alterawiki.com/wiki/fifoed_avalon_uart, a little difficult to "plug" in SOPC.

    OR Write your own buffer(s). It is not so difficult if you understood the principles.

    Reduced drivers : I think they don't work in Interrupt Mode.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    Thanks a lot for your answer.

    Are you sure about the abilty to recieve only one character even at Interrupt mode?

    As I underatand,it has a 64 character buffer. What if then, the buffer is for?
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Are you sure about the abilty to recieve only one character even at Interrupt mode?

    --- Quote End ---

    yes, of course. But if you talk about FIFOed UART, it can receive only one character in interrupt mode, you can set a threshold.

    --- Quote Start ---

    it [FIFOed UART ?] has a 64 character buffer. what if then, the buffer is for?

    --- Quote End ---

    I don't understand (translation problems ?)

    First, if you employ The FIFOed UART (or an other component in QSYS), you have to regenerate the Qsys_component, of course.

    The FIFOed UART will create special memories to store the received character, you will set the connections and size somewhere in QSYS (or SOPC). All are explained in the supplied document (maybe some adaptation have to be done).

    If you write your own buffer : it is just a portion of memory that you index like FIFO (or what you want).
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    other than that,i'm have the problem to interface with gsm module to de2-70,when i am done implemented to the board when i'm trying to send command to gsm module using my phone. It comes nothing happen. So, what i'm should do for enable command can send from phones to gsm module and give feedback to me.