Announcement

Collapse
No announcement yet.

uVGA-II (GFX) Serial buffer

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

  • uVGA-II (GFX) Serial buffer

    Dear all,
    I am fighting very long time with problem of function com1_Init(buffer, bufsize, qualifier)
    As I was looking in command description I could not find what is the necessary value for "bufsize".
    I am trying to get 34 - 120 value and display them.
    But when send some fixed value there is some time problem but is possible to fix it, but when I send changing values the I have many bugs and shifting some values to different areas.
    Baud rate I am using is 38400 on RX1

    I also tried to use controlling pin to tell host micro now send data and now stop sending to avoid some overflow of buffer but in documentation there is some thing like not clear for me to understand about calculation between value of requested amount of value and "bufsize"
    Example from PICASO-GFX2 Internal 4DGL Functions rev.2

    com_Init(combuf, 20, 0 );
    // set up a comms ring buffer, maximum 12 characters before overflow

    I know that here is no qualifier, but why I can receive only 12 chars when bufsize is 20?

    I were using com_Init on uLCD-32PT w/o problem.

    Can some body help me with please.
    thx

  • #2


    Hmm other than the comment being wrong, the only thing you need to do is ensure combuf is (at least) half the size of the number of chars you want to buffer, eg.

    var combuf[10] ;

    com_Init(combuf, 20, 0 );

    is correct to buffer 20 characters.
    Mark

    Comment


    • #3


      That I was thinking like you wrote.
      I tried to put 34 or 35 for bufsize when I receiving 33 values.
      Received values are raw data in range 0-10 so I was thinking that maybe there is something wrong for receiving buffer.
      Because I am using host processor directly for recalculation of values directly to BCD values of each digits to get graphics reaction very fast.
      I also tried to use 12 buffers to split all values and always first 3 sets of data's is working correctly and also fixed data is working correctly only values which are changing very fast is faulty.
      I donĀ“t know reaction time but buffered data in host are ready always each 50 - 100ms so I think that this is not problem of buffer overflow, because if screen have lot of work to do in graphics than send busy signal on IO1 and host is doing other job and testing signal READY from uVGA.

      Comment


      • #4


        Yes the 12 is a typo, should read 20.
        There is an example here which should help:-

        http://www.4dsystems.com.au/code/index.php?node=66&id=79


        Might also be worth having a look at http://www.4dsystems.com.au/code/index.php?node=75&id=98
        Its some very busy comms going on and it doesn't miss a beat.
        Regards,
        Dave

        Comment


        • #5


          Now I am testing bufferedRX.4dg
          from testing I modify little bit code to see data on screen (adding of 0x30 to each).
          and when I made single shot reading data and continues I got on screen strange values:
          [i]Buffered 0 - 1

          Comment


          • #6


            If you are still having problems cab you post the full code?

            Thanks
            Mark

            Comment


            • #7


              So on both COM1 and COM0 was com_Count values same.

              But I change pooling system, remove delays and was better but still some times bug in data's.

              I change BaudRate from 38400 to 115200 and now it is crazy but code is working .

              Thx for your help and ideas.

              Comment


              • #8


                Were you earlier trying to say it worked on a uLCD-32PT but not on a uVGA-II?

                If so, I'd be looking at cable lengths and noise being inserted
                Mark

                Comment


                • #9


                  On uLCD-32PT is same cable length as on uVGA-II around 10 cm.
                  On uLCD was baudrate 9600 and is running more than 200 day continually.
                  On uVGA start working w/o bugs on 115200.
                  For sure when prototyping will be done with all of staff around than with by COM link around 20 mm in PCB.

                  Also what do you think about possibility to transfer *.4XE file to uSD card through uUSB? I think this will be the best idea to have assembled application in the box and need only USB cable to upload all necessary files and also change main code in uVGA.

                  Comment


                  • #10


                    Also what do you think about possibility to transfer *.4XE file to uSD card through uUSB?
                    Sure, if that's what you need to do, go for it. I'd suggest some sort of handshaking and also a checksum be used
                    Mark

                    Comment


                    • #11


                      OK
                      I will try this later because I need to make some software for Windows which will be able to make some data flow control and some screen design functions.

                      Also I am using PCF8574(PCF8575 depend on request for extra outputs) and I see that when I leave I2C running all the time I see some peaks on the PCF outputs (all of them in same time) during running COM. Than I put every where where is I2C used Stop function and this is now w/o peaks.
                      If I use PCF with host CPU there is no peaks like on uVGA with same functions.

                      Sorry for my too stupid questions but I spend more than one month with graphics and data protocols conversions and this two days was very helpful with help of you both.

                      Comment

                      Working...
                      X