Hardware flow control

2 thoughts on “Hardware flow control

  1. I am using a UC864-G with firmware 08.01.127 and I can not get hardware flow control working. I connect to the server using the following:

    AT#SD=1,0,80,”example.com”,0,0,1

    AT#SO=1

    Then I request a chunk of data from the server, around 500 bytes. After I get the first 80 bytes, I set RTS high to stop the flow but the modem just keeps on sending and I end up losing most of the data becuase I can not process it fast enough. I have tried enabling hardware flow control with the various combinations of the following commands:

    AT&K3

    AT+IFC=2,2

    AT+FLO=2

    but none of them seem to work, the modem always ignores RTS.

     

    I am also using the AT&D1 setting in order to switch from data mode back to command mode by using the DTR line. Normally, this works correctly but if I happen to raise RTS while doing this, the modem will either ignore DTR and remain in data mode, or else it will sometimes give me this error:
    ERROR:0x0009 Error Fatal  TASK:UI FILE:ds3gsiolib. LINE:02084 Timestamp:06/28/2011 16:16:54

     

    Are these two problems related? Is there any way to solve one or both?

    1. Hi Tom,

       

      UC864 control the RTS pin in a polling style every 20mS.

      This means that, even if module receive the transition on the pin, event is managed not in a real time but take a little bit of latency.

      This latency can be as high as 512 bytes depending on serial speed.

      As a consequence of this, if you are waiting for 500 Bytes coming from the server you get all of them on the internal buffer before the RTS stop the flow.

      If you have difficult to deal with high rate of downloading I’ll sugggest you to connect in COMMAND MODE ( i.e. something like AT#SD=1,0,<port>,"xx.yy.zzz.kkk",0,0,1 )

      so when the 500 Bytes are buffered you’ll get a SRING message and you can read the date with SREAD when you are ready to do it.