Announcement

Collapse
No announcement yet.

How to get maximum baud rate

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

  • How to get maximum baud rate

    Hello,

    I am working on a Gen4-uLCD-50DCT-CLB, which communicates to a µC via UART.

    I can read on the dsiplay datasheet that the display can handle baud rate from 300 up to 600K.
    I have been working with 300K with no major issue.

    I now need to increase the speed. However, any value above 300K will provide me the same result : 300K !
    Changing the baud rate to a lower value provides the expected result.

    Here is the code I am using.


    #constant BAUD_RATE 60000 // baud rate/10

    COM2_RX_pin(PA10);
    COM2_TX_pin(PA8);
    com_SetBaud(COM2, BAUD_RATE);
    com2_Init(combuf, BUFFER_SERIAL_COM_SIZE,0);



    Am I missing something ?

    Thanks in advance.

  • #2
    Hi Vincent,

    Could you try setting it like this without the constant,

    com_SetBaud(COM2, 60000);

    There are also the special baud rates that are used by using the small number identifier

    1: 2187500 baud
    2: 1458333 baud
    3: 1093750 baud
    4: 875000 baud
    5: 729167 baud

    To set the baud to 1093750 use,

    com_SetBaud(COM2, 3);

    I hope this helps

    Best regards

    Paul

    Comment


    • #3
      Originally posted by pauleilio View Post
      Could you try setting it like this without the constant,

      com_SetBaud(COM2, 60000);

      There are also the special baud rates that are used by using the small number identifier

      1: 2187500 baud
      2: 1458333 baud
      3: 1093750 baud
      4: 875000 baud
      5: 729167 baud

      To set the baud to 1093750 use,

      com_SetBaud(COM2, 3);
      Thanks for your quick feedback Paul.

      I did try both option, but none of them helped ...
      Is there something I might be missing ? Like some #inherit to add to the code, or set the baud rate before changing some other stuff in my code ?

      Comment


      • #4
        Hi Vincent,

        Sorry that didn't work for you. I will do some testing here. There is nothing else you need to do.

        Best regards

        Paul

        Comment


        • #5
          Hi Vincent,

          Could you please let me know which micro-controller you are using. Also could you also check the PmmC version on your display.

          Best regards

          Paul

          Comment


          • #6
            I have a PIC32MX350F hook up to the display. However, I am checking my signal with an oscilloscope.

            I measure a frame of 6 bytes, sent with a sequence like this :

            for(i:=0;i<dataLength;i++)
            serout2(frame[i]);
            next



            I think I found out the problem. When sending frames at lower rate (<300k), all bytes are sent one after another, forming a "decent" frame.
            I then computed the baud rate using the duration of the frame.

            When increasing the baud rate, using for example com_SetBaud(COM2, 3), I can see on my oscilloscope that each byte is actually sent with the correct baud rate (~1M), but there is pause between each byte !

            Therefore, my frame of 6 byte acutally looks like this
            [1 byte = 7.2µs] [Pause = 33µs] [1 byte = 7.2µs] [Pause = 33µs] [1 byte = 7.2µs] ...

            This takes ~194µs to send a 6 byte frame (= Equivalent to 300kbps), which is why I told you the maximum baud rate I could acheive was 300k in the first place !

            Comment


            • #7
              Actually, my piece of code to send the data is a little bit more complexe than what I posted above, an I think this is what could be causing the problem.


              for(i:=0;i<dataLength+1;i++)
              serial_out(frame[i]);
              next



              where serial_out() adds and encoding byte, when necessary.

              func serial_out(var value)
              if((value == START_CODE) || (value == STOP_CODE) || (value == ESCAPE_CODE))
              serout2(ESCAPE_CODE);
              endif

              serout2(value);
              endfunc



              This function call, and the if() condition might explain this latency between each byte ?

              Comment


              • #8
                Hi Vincent,

                You could still try the 600000 baud but use a TX buffer and TXBufferHold, you can find full details on page 257 and page 258 of this datasheet,

                https://www.4dsystems.com.au/product...ions_R_2_0.pdf

                I hope this helps

                Best regards

                Paul

                Comment


                • #9
                  I updated my code in order to have less instructions between two calls of serout2().
                  This seem to have solved my problem.

                  After that, I also implemented the TXBuffer with a TXBufferHold(). Not really needed since my communication is now to the speed I need. Not sure if I should keep it or not.

                  Thanks.

                  Comment

                  Working...
                  X