Announcement

Collapse
No announcement yet.

How to detect visi genie display is thier or not.

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

  • #16
    Hi Doff thanks for your valuable reply,

    Ok, I tried with pooling method but also it giving same issue. display is not communicating properly.

    here is my code:

    INT main(void)
    {
    InitializeBoard();
    Initialize_DISPLAY_COM(); // initializing uart port
    Initialize_MOTOR_COM();

    while(1)
    {

    PORTEbits.RE7=1;
    genieDoEvents();
    genieFrame Event;
    genieDequeueEvent(&Event);
    genieWriteObject(GENIE_OBJ_FORM, 1, 0);

    }
    }

    Here i am not using interrupt method.

    But also not working. Or any other method is their to do poling if it is their please let me know.

    Please help me.

    Regards
    Manjunath N N

    Comment


    • #17
      Hi Manjunath N N,

      display is not communicating properly.
      My suggestion is that you first test the display using the GTX tool in Workshop. Have a play and familiarize yourself with the different commands - READ_OBJ, WRITE_OBJ, WRITE_STR, WRITE_ STRU, WRITE_ CONTRAST, REPORT_OBJ, REPORT_EVENT, etc.

      Test each of these commands and see if they are successfully sent, received, interpreted, and/or executed by the display module. If you find anything wrong while doing this test, then perhaps there is something wrong with the display. Kindly document the errors (if there are any) through images and descriptions and send them to us.

      However, if you don't find any error while testing the display module with the GTX tool, then the next step is to ensure that your host is programmed properly, i.e., it sends the correct command, it properly buffers and handles the commands coming from the display, it waits for the ACK byte, etc.

      The application note

      ViSi-Genie Interfacing a PICASO Display to a PIC micro Controller
      http://www.4dsystems.com.au/appnote/4D-AN-00021/


      comes with a basic C library developed using the PIC18F45K20 PIC MCU. I trust that you can modify and/or improve this to suit your application or host. More application examples are provided in

      ViSi-Genie Serial Displaying ADC Results from a PIC micro Controller and
      ViSi-Genie PWM Control with a PIC MCU

      http://www.4dsystems.com.au/appnote/4D-AN-00020/
      http://www.4dsystems.com.au/appnote/4D-AN-00022/

      The issues that you're having - the interrupt functions not working with the bootloader and the polling method not seeming to work - I think these are more related to your host controller. If you have ascertained that there is really something wrong with the display, please document these and let us know. Otherwise, my only suggestion at the moment is that you seek help in the Microchip community.

      Hope this helps and regards.
      Doff

      Comment


      • #18
        Hi Doff thanks for reply,

        I tested the code it is not a issue with display, it is with uart. uart is not working properly in that application. your Display is working fine.

        once again thanks for your valuable response.

        Regards
        Manjunath N N

        Comment


        • #19
          Hi 4D people with your help i did screen saver and also some best applications.

          Now i am again went back to on-fly detect. I can able to detect the presence of lcd, but not on-fly detect. I previously posted this query but i did't get any positive reply

          This time i hope i may get my expected result. Because you are only the hope for me.

          I really facing issue here:
          When application is running at first time, at that time lcd is not connected. I am keep on sending request to display with this command genieReadObject(GENIE_OBJ_FORM, 0x00).
          After some time if i connect the display to my board it should respond, but it is not.

          If any one knows about this issue, please help me how to solve.

          Regads
          Manjunath N N

          Comment


          • #20
            Hi Manjunath N N,

            Were you able to account for the fact that the display module needs a certain amount of delay, after being powered on, before it can start receiving messages?
            Also, is it possible for you to show some diagrams of your implementation and perhaps a logic analyzer data log of the communication between your host and the display during on-fly detection?

            Regards.
            Doff

            Comment


            • #21
              Hello Manjunath

              I thought I would reply also - as your application seems.... unique.

              To start with, why is the display sometimes connected, and sometimes not? This really is not a typical situation, and I really don't know how the library will handle that.
              It is written to assume the display is always there, when its programmed to be there, and if its not there it would time out and cause all sorts of potential issues.

              Why is your display sometimes not connected?
              Why could the display be removed during normal operation?

              These things dont quite make sense - we have never seen the need for an application like this, and therefore our software library is not written to handle something like this...
              To an extent, you are almost going to have to rewrite parts of the library yourself, if you experience any issues.

              Regards
              James

              Comment


              • #22
                Hi Doff,

                Thanks for kind reply,

                I am sorry to say i can't share any photos because it is confidential project, please don't mind it. But i am using your company display only.

                I will explain the situation what i am facing here.

                1. Display is not connected to board, then i powered the board. At that time led should not glow, it is working fine with this case.

                2. After some time if i connect the display, it should detect by my hardware by making LED ON. But LED is not going ON after some delay also, as you told.

                3. In this case some what different than previous cases that is, initially display is connected to board but board is not powered ON.

                4. Once i powered ON the board, display is getting on by making LED ON on my board. This means display is detected by the board. Its working fine.

                But not working in 2nd point properly, how to make it work. Please help me.

                I hope you understand my query. If not please kindly let me know, i will go for better way than this.

                Regards
                Manjunath N N

                Comment


                • #23
                  Hello again Manjunath

                  It may be better to take this off the forum, and use email.
                  We can discuss NDA as we will be able to support you better if we have some specific information, as at the moment I am unsure how to support your situation.

                  If you have an NDA agreement you would like us to look over, please email it to me, james at 4dsystems dot com dot au
                  If you do not have one, we could send you one of ours.

                  This is purely to support you better.

                  Kind Regards
                  James

                  Comment


                  • #24
                    genie.Resync() may be what you need, I am not sure.

                    Have a look in the genieArduino.cpp library file, and go down to the Resync function.

                    You may be able to call this at some point to reinitialise the library, but really - to detect a display that you have just plugged in, I am not sure how you will get the system to detect that, without having some sort of trigger to tell either end that its been connected.

                    You might have to look at using Genie Magic, which is part of Workshop4 Pro, and have it set a GPIO when its powered up, to tell the Arduino to call the Resync() function to start the comms back up again.

                    Just a few ideas you could try.

                    Regards
                    James

                    Comment


                    • #25
                      Hi 4D people,

                      I got some idea for on-fly detect, that is continuously writing and reading the custom led digit. Here i can able to write into custom led digit, but i am unable to read the values on it. I searched the lots of code but i did not get how to read the values on custom led digit.
                      If you have any sample code OR code links can you please share me, because in visi genie library i did't get any read function.

                      So please help me.

                      Regards
                      Manjunath N N

                      Comment


                      • #26
                        I think this might be the same question that was just answered here http://forum.4dsystems.com.au/forum/...object-problem
                        Mark

                        Comment


                        • #27
                          Hi 4d people,

                          Thanks for your support,

                          I tried what you people told me, but i am unable to read the custom digit value.

                          Here is my code:

                          Code:
                          uint8_t led_data = 0;
                          main()
                          {
                            // Setup the system clock
                            Initialize_SYSTEM();
                            // Set up the UART for display. This setup will also request the current form from the display to ensure that the display is connected.
                            // The initialization routing has an inbuilt delay of about 5 seconds for the display to reset and reboot.
                            Initialize_DISPLAY_COM();
                            A_LED = 1;
                            // This is for the genie library event handler for processing replies from the display
                            genieAttachEventHandler(uLCDEventHandler);
                          
                            Init_Timer_1();
                            A_LED = 1;
                            //Starting timer 1
                            T1CONbits.TON = 1;
                          
                            while (1)
                            {
                              if (led_data == 0 )
                              {
                                check_LCD_present = false;
                                A_LED = 1; // this led always ON if LCD present also, but for me it should ON when LCD is not their.
                                // Intially it should be ON as my logic later it should go off, once it read the custom digit value. But its not happening.
                                // This shoes i am unable to read the custom digit value.
                              }
                              else
                              {
                          
                                Lcd_Present = 0;
                                led_data = 0;
                                check_LCD_present = true;
                                A_LED = 0;
                          
                              }
                          
                          
                              if (lcd_time == 30) /// for small delay
                              {
                                genieWriteObject(GENIE_OBJ_CUSTOM_DIGITS, 2, 22);
                                lcd_time = 0;
                              }
                              genieReadObject(GENIE_OBJ_CUSTOM_DIGITS, 0x02); // writing to get response from lcd
                              genieDoEvents();
                          
                            }
                          }
                          
                          void Init_Timer_1()
                          {
                            T1CONbits.TON = 0; // Disable Timer
                            T1CONbits.TCS = 0; // Select internal instruction cycle clock
                            T1CONbits.TGATE = 0; // disable Gated Timer mode
                            T1CONbits.TCKPS = 0b11; // Select 1:256 Prescaler
                            TMR1 = 0x00; // Clear timer register
                            PR1 = 60000; // Load the period value
                            IPC0bits.T1IP = 0x01; // Set Timer 1 Interrupt Priority Level
                            IFS0bits.T1IF = 0; // Clear Timer 1 Interrupt Flag
                            IEC0bits.T1IE = 1; // Enable Timer1 in
                          
                          }
                          
                          void __attribute__((__interrupt__, no_auto_psv)) _T1Interrupt(void)
                          {
                            lcd_time++;
                            IFS0bits.T1IF = 0;
                          
                          }
                          
                          void uLCDEventHandler()
                          {
                            genieFrame Event;
                            genieDequeueEvent(& Event);
                            // enable the LCD touch
                            Lcd_touch = true;
                            //If the cmd received is from a Reported Event (Events triggered from the Events tab of Workshop4 objects)
                            if (Event.reportObject.cmd == GENIE_REPORT_EVENT)
                            {
                              // check for custom digits
                              if (Event.reportObject.object == GENIE_OBJ_CUSTOM_DIGITS)
                              {
                                if (Event.reportObject.index == custom_digit2)
                                {
                                  led_data = (uint16_t) (Event.reportObject.data_msb < < 8) + Event.reportObject.data_lsb; // I am thinking it is not even coming to this part.
                                }
                              }
                            }
                          }
                          Please kindly help me is their any issue in my code.

                          Regards
                          Manjunath N N

                          Comment


                          • #28
                            Hi Manjunath N N,

                            In your code the event handler routine seems to be waiting for a REPORT_EVENT message instead of a REPORT_OBJ message.

                            ​As Mark pointed out above, the difference between a REPORT_EVENT message and a REPORT_OBJ message was discussed by James in another thread:

                            http://forum.4dsystems.com.au/forum/...object-problem



                            Regarding the implementation of an on-the-fly detection of the display, I would suggest that you really consider James' post above (#24).


                            In your previous post (#22 above),

                            1. Display is not connected to board, then i powered the board. At that time led should not glow, it is working fine with this case.

                            2. After some time if i connect the display, it should detect by my hardware by making LED ON. But LED is not going ON after some delay also, as you told.

                            3. In this case some what different than previous cases that is, initially display is connected to board but board is not powered ON.

                            4. Once i powered ON the board, display is getting on by making LED ON on my board. This means display is detected by the board. Its working fine.
                            In step 2, the display (assuming that it is initially powered off) will not work most likely since the moment you connect it (and power it on) to the host (which was powered up in running in step 1), it (the display) will be immediately receiving messages from the host. Again, the display needs some time to properly initialize before it can understand the messages correctly.

                            In steps 3 and 4, the display is initially powered on and is ready to receive messages after the required start up delay. So the moment that you power up the host, it will start sending messages to the display, which is ready to accept them.

                            Hence, the need for a "trigger" to let the display and the host know that the connection has been made (James' post #24 above).

                            Regards.
                            Doff

                            Comment

                            Working...
                            X