Announcement

Collapse
No announcement yet.

commumication with PIC . Pls Help!

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

  • commumication with PIC . Pls Help!

    I have problem regarding communication with PIC.
    I want to do communication test by simple test.
    My environment is bellow.
    uLCD-320pmd2 (installed uLCD-320-PMD2-uSD-Serial_rev2.pmmc)
    Module and PIC are connected (Rx-1K-Tx, Tx-Rx,V-V,G-G,
    Reset-free)
    PIC TEST Code is below.
    --------------------------------------------------------------
    #include
    #fuses HS,NOWDT,NOPROTECT,PUT,BROWNOUT,NOLVP
    #use delay(CLOCK = 20000000)
    #use rs232(BAUD = 9600, XMIT = PIN_C6, RCV = PIN_C7)
    #define uOLED_DETECT_BAUDRATE 0x55
    #define uOLED_CLEAR 0x45
    void main()
    {
    delay_ms(800);
    putc(uOLED_DETECT_BAUDRATE); // auto-detect baudrate
    putc(uOLED_CLEAR); // Clear screen
    if (kbhit ()) { getc (); }
    while(1)
    {
    putc(0x41);
    putc(0x00);
    putc(0x01);
    putc(0x18);
    putc(0x24);
    putc(0x42);
    putc(0x81);
    putc(0x81);
    putc(0x42);
    putc(0x24);
    putc(0x18);
    if (kbhit ()) { getc (); }
    }
    }

    -----------------------------------------------------
    Module and PIC power on , nothing change.
    Just showed " 4D-system".
    Please somebody help me. !!!

  • #2


    Koby,
    Try the following steps:[list type=decimal][*]Remove the 1K series resistor between PIC Tx - uLCD Rx. Make direct connection between PIC Tx and uLCD Rx.[*]Increase the 800ms Power Up delay to 2000ms.[*]After sending the Auto Baud character (0x55) look for the ACK (0x06) character.After receiving the ACK then send "Clear Screen" command, 0x45.If at the end of the above steps you end up with a clear screen then you have established coms between your PIC and the uLCD module.Always remember, after sending each command make sure to monitor and wait for the ACK or provide enough time to make sure the ACK would have been sent by the uLCD.[/list type=decimal]Let us know how you go......

    By the way, latest PmmC is rev5 and it's available for download.
    Atilla

    Comment


    • #3


      Great! It's working now.
      Thank you so much!

      If I install rev.5 ,
      GraphicsComposer was not working.
      That's why, I'm using, rev.2 . I don' know.

      I could move forward by your help. again, Thanks!!

      Comment


      • #4


        Graphics Composer is now rev 2.0.0.4 is that the version you have?
        Atilla

        Comment


        • #5


          Yes. 2.0.0.4 I have.

          Comment


          • #6


            We're having a closer look at the Graphics Composer and will make another release if we find any issues.
            Atilla

            Comment


            • #7


              Hey friends with help of this post I have managed to draw two circles on the screen ULCD-144-GFX, and send commands sequentially as this code for every instruction I give pause for 2000ms, I would like to know how to send commands but linearly? and so in this way that I first draw a circle and then another, in short the code is executed from top to bottom, I want to start show me the two circles at the moment. Greetings and I leave the code we realize.


              #include
              #fuses NOWDT,NOPROTECT,NOPUT,NOBROWNOUT,NOLVP
              #use delay(clock=4Mhz) //cristal de 4 mhz
              #use rs232(uart1,baud=9600,bits=8,parity=N, stop=1)
              #define uLCD_DETECT_BAUDRATE 0x55 // auto-detect baudrate
              #define ACK 0x06 // Acknowledge
              #define NAK 0x15 // Not Acknowledge
              #define uLCD_CLEAR 0x45 // Clear screen

              void main()
              {
              delay_ms(2000);
              putc(uLCD_DETECT_BAUDRATE); // auto-detect baudrate
              putc(uLCD_CLEAR); // Clear screen
              if (kbhit ()) { getc (); }
              while(1)
              {

              delay_ms(1500);

              putc(0x42); //comando para color de fondo de pantalla
              putc(0x00); //color negro= 0x0000
              putc(0x00);

              //! delay_ms(1500);
              //!
              //! putc(0x70); //comando de relleno
              //! putc(0x01); //vacio=01hex lleno=00hex

              delay_ms(1500);

              putc(0x43); //comando circulo
              putc(0x23); //x
              putc(0x58); //y
              putc(0x19); //radio
              putc(0x07); //color msb Verde= 07E0hex
              putc(0xe0); //color lsb

              delay_ms(1500);

              putc(0x43); //comando circulo
              putc(0x60); //x
              putc(0x58); //y
              putc(0x19); //radio
              putc(0xf8); //color msb Rojo= F800hex
              putc(0x00); //color lsb

              if (kbhit ()) { getc (); }
              }

              }

              Comment


              • #8


                What do you mean by 'Linear'?

                If you'd like to send commands quicker, then you need to wait for the ACK/NAK from each command, as per the manual
                Mark

                Comment

                Working...
                X