9 years, 9 months ago.

problem running the program

/media/uploads/patrickovermaat/diagram.png

hi,

I am using your library for a school project with the ulcd70DT touchscreen connected to the mbed.

when i try to write a object nothing happens and it just shows the current time and time out.

when i compile your test program it does the same,

i have declared the 4dsystems class like this : Mbed4dGenie genie(p9,p10,p11);

do you have any idea what i am doing wrong?

*update*

current_programm_using_the_4dGENIE_library

#include "mbed.h"
#include "mbed_genie.h"
 
Mbed4dGenie genie(p9,p10,p11); 
int flag=0; 
 
void myGenieEventHandler(void)  //Event handler for the 4d Systems display
{
    genieFrame Event;
    genie.genieDequeueEvent(&Event);
    
    //event report from an object
    if(Event.reportObject.cmd == GENIE_REPORT_EVENT) 
    {        
        if (Event.reportObject.object == GENIE_OBJ_WINBUTTON) // If the Reported Message was from a winbutton
        { 
            if (Event.reportObject.index == 0) 
            {
                printf("on button pressed\n\r");
                flag =1;
            }
                
            if (Event.reportObject.index == 1) 
            {             
                printf("off button pressed\n\r"); 
                flag=0;
            }
            
        }

        

            //Cmd from a reported object (happens when an object read is requested)
            if(Event.reportObject.cmd == GENIE_REPORT_OBJ) {

            }
        }
}
 
int main()
 
{
    genie.Start();
    genie.genieAttachEventHandler(&myGenieEventHandler); // Call the event handler 
    
    printf("Test code for Patrick \n\r");  // Display a welcome message on the serial monitor
 
    while(1) 
    
    {                                                  // initialise an infinite while loop
    
    genie.genieWriteObject(GENIE_OBJ_USER_LED,1,flag);      // Set the USERLED0 object high if button 0 is pressed and low if button 1 is pressed  
    
    wait(1);                                           // Wait one second      
    
    }
}

*Update* My screen works now, there was a bad connection between my rx ans tx pins.

I want to thank you for helping me solve this problem!

Question relating to:

Mbed 4dGenie class Visi-Genie

Have you set the module to 'Serial Slave' mode? see page 7 of the serial command set reference manual. In this mode it initialises at 9600 baud. That is very slow!. When you get it working you can change the baud up to 600k depending on the Mbed you are using.

posted by Paul Staron 11 Feb 2015

3 Answers

9 years, 9 months ago.

Hi Patrick,

As Paul said, you need to connect all grounds together (Mbed, 4d system programming header and the external power supply)

Did you confirm that your power supply can provide enough current to power the LCD?

Have you tested the Visi Genie project with the workshop IDE? there is a tool called GFX that will help you test the program on the 4d screen.

On my side, i have created a Visi Genie project with a single userLed and used the Mbed code you provided.I used the code that you provided. It works on my side (The led on the 4d screen blinks)

I have tested this code on the FRDM-K64F and FRDM-KL46Z and both works. I could not test it with my Mbed, it had an unfortunate accident and does not work anymore.

If you need it i could provide you my Visi Genie project.

Christian

Accepted Answer

Hi Christian,

Thanks for your comment!

I have now connected all the grounds together, but stil the program doesnt work. The power supply does provide enough current.

I have tried it at 9600 baud and 115200 baud also nothing changes. I have used the GFX tool to test the program. everything worked there.

Can you provide your project to me? maybe that project will work.

Regards,

Patrick

posted by patrick overmaat 12 Feb 2015

Hi Patrick,

Stay at 9600 since the library defaults to that speed. I will be able to send you the project file later today.

In the mean time, can you monitor the serial output comming out of the mbed(data that the mbed sends to the 4d screen). Can you confirm that there is some commands behing sent?

When pressing reset on the mbed, do you see the 4d screen reset? When the code reaches the .Start(), the 4d screen should reset.

Regards,

Christian

posted by christian b 12 Feb 2015

Hi Christian,

Oké I will stay at 9600 baud then.

i do not know how to monitor the serial output comming out of the mbed. but i can confirm that commands are being send becouse when i reset the mbed the screen resets.

Regards,

Patrick

posted by patrick overmaat 12 Feb 2015

Hi christian,

Are you still able to send your project to me?

And could you test my current program (i have updated my original question) if it is working?

Regards,

Patrick

posted by patrick overmaat 16 Feb 2015
9 years, 9 months ago.

Hi Patrick,

Can you share the rest of your code please. It is difficult to provide assistance without seeing all of the code. Can you also share a diagram of how you have connected the ulcd70DT display to the mbed and can you share what you would like to achieve - what do you want to use the display to do in conjunction with the mbed.

There does not appear to be an issue with the syntax you have provided but that doesn't really help with the rest of your problem.

Regards

Alex

Hi Alex,

thank you for your quick answer.

we are using the touch screen to control a testing system. We are using the touchscreen to start the test and show the test resuslts on 16 leds.

so we need to know when the start button is pressed and we need to change the 16 leds.

i have updated my original question with a diagram. the tx pin from the lcd is connected to p10, the rx pin from the lcd is connected to p9, the reset pin from the lcd is connectedto p11 ( i do not use the reset function), the 5v pin from the lcd is connected to a external power supply becouse when i connect it to the mbed it drains to much power and the mbed shuts off. the gnd pin is connected to a external power supply.

i am using a simple program first to change a single led on the screen. this program:

test

#include "mbed.h"
#include "mbed_genie.h"
 

Mbed4dGenie genie(p9,p10,p11);
 
 
int main() {
genie.Start();
 
    while(1) {
       
        genie.genieWriteObject(GENIE_OBJ_USER_LED,0,1);
      
    }
}

when i run this program it doesnt change anything.

i hope this helps, and if you need more information i am happy to provide it.

regards,

Patrick

posted by patrick overmaat 11 Feb 2015

Hi Patrick,

Thank you for the extra information. Things become a little clearer now. I wrote a similar program using a 4.3 inch 4D systems display and the mbed last year.

http://langster1980.blogspot.co.uk/2014/07/mbed-4d-systems-display-tutorial-with.html

The first thing I noticed is that there is not a 1k Resistor connected in series with pin 11 which is required to ensure the display reset line is controlled. I believe its a requirement of 4D system displays.

My next question is with reference to the code posted....

If I am understanding your code correctly you are trying to cause an LED Object on the display to change state continuously?

The 'Knop' variable is not doing anything...

If I may i think the following code might work slightly better. I cannot test it however as I don't have my programming lead to hand to check it with the display.

#include "mbed.h"
#include "mbed_genie.h"

Mbed4dGenie genie(p9,p10,p11); //

int knob = 0;  //holds the status of the knob object?  


int main()

{
    genie.Start();
    
    printf("Test code for Patrick \n\r");  // Display a welcome message on the serial monitor

    while(1) 
    
    {                                                  // initialise an infinite while loop
    
    genie.genieWriteObject(GENIE_OBJ_USER_LED,0,1);      // Set the USERLED0 object on the display high 
    
    wait(1);                                           // Wait one second   
    
    genie.genieWriteObject(GENIE_OBJ_USER_LED,0,0);      // Set the USERLED0 object on the display low 
    
    wait(1);
    
    }
}

Please ensure you have a 1k resistor in the reset line and that you have imported the 4Dgenie library into your program.

Good luck!

posted by Alexander Lang 11 Feb 2015

hi alexander,

i have now add a 1k resistor to p11.

when i just copy and paste your program and run it it stil does nothing, i have also changed the baud rate from 9600 to 115200 but that also didnt change anything. when i check my serial monitor it shows the current time, and time out. when i check the library to see why it does that it, is if i am right, becouse the "write object" failed to write the object.

regards,

Patrick

posted by patrick overmaat 12 Feb 2015
9 years, 9 months ago.

Hi Patrick,

You need a GND connection between the 4D systems programming header and the mbed (pin 1).

Hope this helps!

thanks for your comment!

unfortunately changing the ground from the external power supply to the mbed only changes that the screen wont turn on. so i need the ground connection from the programming header with the external power supply .

posted by patrick overmaat 11 Feb 2015

You need both!

posted by Paul Staron 11 Feb 2015

yes you are right, i now have a ground connection between the programming header, the mbed and the power supply, it however does not make my program work

posted by patrick overmaat 12 Feb 2015

Have you set the module to 'Serial Slave' mode? see page 7 of the serial command set reference manual. In this mode it initialises at 9600 baud. I do not have one of these displays (I have other Oled Picasso type), so not sure if this is relevant here.

posted by Paul Staron 12 Feb 2015

hi Paul,

yes i have set it to serial slave mode, but this type of screen should be serial slave ready out of the box, but just to be sure i have done it another time today. thank you for your comment!

regards

patrick

posted by patrick overmaat 12 Feb 2015

Assigned to christian b 9 years, 9 months ago.

This means that the question has been accepted and is being worked on.