Announcement

Collapse
No announcement yet.

uCAM II, PIC18 AND uLCD-70DT

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

  • uCAM II, PIC18 AND uLCD-70DT

    Hello,

    I have in my design the uCAM II module connected to a PIC micro-controller. I managed to sync the camera and get JPEG picture data from it, I now want to send that data via UART from the micro-controller to the uLCD-70DT to display the picture. Can I display a JPEG image on the uLCD-70DT display? If so can you help with a library/ routine to achieve this with image data coming from UART port (no direct connection between uCAM and Display)?

    If I can not display a JPEG image on the display, can you assist with displaying RAW image receiving data from UART port?
    I would also prefer to be able to save the picture on uSD card.

    Thank you.
    Last edited by Phalits; 4th April 2018, 11:44 PM.

  • #2
    Hello,

    It isn't possible to display the jpeg picture on your uLCD-70DT, it will have to be in the RAW format.

    If you are using Visi you could use these commands

    disp_setGRAM(x1, y1, x2, y2)
    // signal PIC to send data over serial
    disp_BlitPixelsFromCOMn()

    You can find details of this command on page 196 https://www.4dsystems.com.au/product...ions_R_2_0.pdf

    Once it is on the screen you can then use this command

    file_ScreenCapture(x, y, width, height, handle)

    to save the image onto the SD card. You can find more details on page 319.

    You would have to communicate with your PIC to tell it to get the picture from the uCAM and serially transfer the RAW image data to the display. The image will be made up of 2 bytes per pixel representing a RGB565 colour.

    I hope this helps

    Best regards

    Paul

    Comment


    • #3
      Thank you for the reply, I managed to display the RAW picture with uLCD-70DT. The function disp_BlitPixelsFromCOMn() woks well with uLCD-70DT but looks like it is not supported in PICASO (using the uLCD-32PTU). How to add two bytes to get a 16bit pixel color word for the picaso display?.

      This is the code I am using:

      var color, count, char;

      disp_setGRAM(57, 87, 184, 214);
      count:=0;
      while(count<16384)
      recv();
      color:=char*0xff;
      recv();
      color:=color+char;
      disp_WrGRAM(color);
      count++;
      wend

      I do get it to display but the picture pixels are not exact. I am using 128x128 resolution. How do I get color to be a 16bit value? where recv() function returns with a byte in char from serial.

      Looks like PICASO does not support disp_BlitPixelsFromCOMn() function.

      Comment


      • #4
        Hi,

        That's great

        Try this, it was only missing << 8

        disp_setGRAM(57, 87, 184, 214);
        count:=0;
        while(count<16384)
        recv();
        color:=char << 8; // shift to the left by 8 bits
        recv();
        color:=color+char; // or you can use color = color | char
        disp_WrGRAM(color);
        count++;
        wend

        Best regards

        Paul

        Comment


        • #5
          Can I receive the jpeg image via serial and save on the uSD card without having to display it? if so how can I achieve that?

          Comment


          • #6
            Hi,

            Yes you can do this by opening a file for write and sending the serial received bytes in chunks.

            hndl1 := file_Open("image.jpg", 'w');

            You can receive the serial bytes into a buffer first and then send the buffer to the SD card using.

            file_Write(buf, 100, hndl1);

            and when you have finished writing the file

            file_Close(hndl1);

            Best regards

            Paul

            Comment


            • #7
              Thank you, I managed to display the pic on PICASO and DIABLO processors and save the images.

              Thanks a lot.

              Comment

              Working...
              X