Announcement

Collapse
No announcement yet.

Serial communication

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Serial communication

    Good morning,
    i'm using the module uLCD 32PT with a uP board that send some informations with serial port at 19200N81, but some time the uLCD don't recive correctly. Which is the max tollerance of the baud rate supported by the uLCD32 ?.

    Max - Italy

  • #2


    If you were sending nice clean 0 - 3.3v ttl signal the acceptable baud rate error would be about 3%. The acutual baud rate at 19200 is 0.16% high.

    It sounds odd that you are seeing any errors.

    How are you geting the 32PT to 19200, how are you connecting to it, over what distance and in what sort of environment?
    Mark

    Comment


    • #3


      Hello,
      the uLCD is connected to a PIC18 microprocessor (working at 5 volt) with a short cable, about 10 cm. The PIC18 send every 300 mS about 100 byte to uLCD. I use the function com1_Count() to know the byte received, some time the function return 0 byte; when this appen the only way it's to reset the uLCD and after the communication start again correctly.

      Max - Italy

      Comment


      • #4


        Are you checking com_Error()?

        com_Init() should recover from any error.

        How are you driving the comms on the display such that you can say "some time the function return 0 byte"? If you are sleeping for 300ms and then expecting something eventually drift between the Display and the PIC18 will mean a 'missmatch'.

        How long does it take the display to process the 100 bytes? Maybe it's taking a bit over 300ms?

        How big is your comms buffer?
        Mark

        Comment


        • #5


          Hello,
          i'll use the function com_error.
          The program is build around two task scheduled by one system timer:
          1 Task_win -> used to display the informations every 200 mS
          2 Task_ser -> read the byte present in com_buffer (size 500) every 50 mS : wait the ending of the trasmission from PIC18 (100 byte every 300 mS @ 19200) and copy the bytes from com_buffer to local buffer. This buffer is used by Task_win that process the informations received.

          The issue it's strange because when the com_count report 0 byte, the only solution is to reset the uLCD.

          Thanks for the support,
          Max - Italy

          Comment


          • #6


            This bit from the manual may be relevant

            "If any low level errors occur during the buffering service (such as framing or overrun)
            the internal COM_ERROR flag will be set (which can be read with the
            com_Error() function). Note that the COM_FULL flag will remain latched to indicate
            that the buffer did become full, and is not reset (even if all the characters are read)
            until the com_Init(..) or com_Reset() function is issued."

            Also about 52 of that 300ms is going to be spend waiting for your data, are you sure you are going to be able to process it in the remaining 248ms, or is part of it just going to keep 'remaining' until the buffer overruns.
            Mark

            Comment


            • #7


              Hello,
              the Task_ser i executed every 50 mS therefore if occurs 4 times in the "free time" of 248 mS from the commincations from PIC18. The Task_ser save and free the buffer of serial communication. This evening i'll try the com_Error().

              Thanks,
              Max-italy

              Comment

              Working...
              X