You will need to power the screen with 5V. Beware! Some screens need more power than the computer USB link can provide. For my screen, I had to use an external 5V source.
If you use an external power source, make sure the mbed ground and external power ground are linked otherwise the serial commands will not be received correctly by the screen.
Use one of the three Serial pairs of pins (p9, p 10) (p13, p14) or (p27, p28) from the mbed to connect them with the screen.
There is a modified version of this library available which corrects the following assert "*** assertion failed: 0, file serial_api.c, line 115". It can be found here:
Fixed a few minor issues in 4DGL library
Moved pc serial port object used for debug output into 4DGL object itself. Previously it was a global object but its constructor wasn't getting run before the global constructor for the 4DGL object itself which led to an assert in the serial code.
I also fixed a few potential buffer overruns that I saw in the code as well.
Thank you for your program and library, it allowed me to evaluate the effectiveness of mbed with a 4D TFT touch display. There are however a couple of minor points about the documentation.
It seems that you have written a wrapper around the SGC commands, where the mbed is the host microcontroller. This is in contrast to GFX, which creates a standalone module out of the display, and 4DGL is a programming language for GFX-based displays. Please find the definitions of SGC (Serial) and GFX (4DGL) platforms below, which has come from 4D Systems:
"(SGC) Serial Platform:
The (SGC) Serial-Platform modules are based on the PICASO-SGC Serial Graphics Controller chip. In this mode, the PICASO-SGC becomes the slave device controlled by an external host controller. This allows you to develop your graphics applications using the host controller’s development platform and software tools. The PICASO-SGC chip has a rich set of serial commands built inside the chip and the commands are sent from the host controller via the serial (UART) interface. All it takes is a few bytes of serial data from the host controller and you can quickly and easily draw lines, circles, text and even display Images as well as play Video clips.
(GFX) 4DGL Platform:
The (GFX) 4DGL-Platform modules are based on the PICASO-GFX2 Graphics Controller chip. In this mode, the PICASO-GFX2 becomes a standalone device and all application code is written in 4DGL (4D Graphics Language). Don't let the name scare you off, 4DGL is an easy to learn but a powerful high level language. It allows the developer to write applications in a high level syntax similar to popular languages such as BASIC, C and Pascal and run it directly on the PICASO-GFX2 processor. The (GFX) modules are stand alone devices. It allows the user to take complete control of all available resources on the module such as the Serial Port, the graphics display and the micro-SD memory card. It provides the user complete control over the display module allowing them to offload a lot of overhead from the host processor by creating the 'work horse' objects within the display module itself.
NOTE:
There is only a single PICASO chip on the module. The chip can be configured to be either a PICASO-SGC or a PICASO-GFX2 by programming the appropriate PmmC configuration file (Personality module micro Code) in to the chip. Think of it as a soft silicon where the silicon can be reconfigured via the PmmC file."
Would it be possible to please change the references from 4DGL to 4D SGC in your documentation, to avoid confusion for other users?
Thanks and regards,
Anna.
Dear Stephane,
Thank you for your program and library, it allowed me to evaluate the effectiveness of mbed with a 4D TFT touch display. There are however a couple of minor points about the documentation.
It seems that you have written a wrapper around the SGC commands, where the mbed is the host microcontroller. This is in contrast to GFX, which creates a standalone module out of the display, and 4DGL is a programming language for GFX-based displays. Please find the definitions of SGC (Serial) and GFX (4DGL) platforms below, which has come from 4D Systems:
"(SGC) Serial Platform:
The (SGC) Serial-Platform modules are based on the PICASO-SGC Serial Graphics Controller chip. In this mode, the PICASO-SGC becomes the slave device controlled by an external host controller. This allows you to develop your graphics applications using the host controller’s development platform and software tools. The PICASO-SGC chip has a rich set of serial commands built inside the chip and the commands are sent from the host controller via the serial (UART) interface. All it takes is a few bytes of serial data from the host controller and you can quickly and easily draw lines, circles, text and even display Images as well as play Video clips.
(GFX) 4DGL Platform:
The (GFX) 4DGL-Platform modules are based on the PICASO-GFX2 Graphics Controller chip. In this mode, the PICASO-GFX2 becomes a standalone device and all application code is written in 4DGL (4D Graphics Language). Don't let the name scare you off, 4DGL is an easy to learn but a powerful high level language. It allows the developer to write applications in a high level syntax similar to popular languages such as BASIC, C and Pascal and run it directly on the PICASO-GFX2 processor. The (GFX) modules are stand alone devices. It allows the user to take complete control of all available resources on the module such as the Serial Port, the graphics display and the micro-SD memory card. It provides the user complete control over the display module allowing them to offload a lot of overhead from the host processor by creating the 'work horse' objects within the display module itself.
NOTE:
There is only a single PICASO chip on the module. The chip can be configured to be either a PICASO-SGC or a PICASO-GFX2 by programming the appropriate PmmC configuration file (Personality module micro Code) in to the chip. Think of it as a soft silicon where the silicon can be reconfigured via the PmmC file."
Would it be possible to please change the references from 4DGL to 4D SGC in your documentation, to avoid confusion for other users?
Thanks and regards,
Anna.
Will you please let me know what is status variable doing in "status = ecran.touch_status();"
I see it returns sometimes 1 , sometimes 2 or 3 . I am unable to understand. pl. help.
Thanks antony
Stephane,
Will you please let me know what is status variable doing in "status = ecran.touch_status();"
I see it returns sometimes 1 , sometimes 2 or 3 . I am unable to understand. pl. help.
Thanks antony
Will you please let me know what is status variable doing in "status = ecran.touch_status();"
I see it returns sometimes 1 , sometimes 2 or 3 . I am unable to understand. pl. help.
So you get a 1 when you press the screen, a 2 when you remove your finger and a 3 if you move your finger while pressing the screen.
I need to spend some time to write the documentation.
Cheers,
<<quote jobyiuac>>
Stephane,
Will you please let me know what is status variable doing in "status = ecran.touch_status();"
I see it returns sometimes 1 , sometimes 2 or 3 . I am unable to understand. pl. help.
Thanks antony
<</quote>>
Coming from the screen manual (p44) :
0 : No Touch Activity
1 : Touch Press
2 : Touch Release
3 : Touch Moving
The library supports all values.
So you get a 1 when you press the screen, a 2 when you remove your finger and a 3 if you move your finger while pressing the screen.
I need to spend some time to write the documentation.
Cheers,
Stephane,
Thanks for above information. I have used your library for some touch panel
buttons. It is useful.
But I have been facing a problem which is quite ununderstantable to me. I am using
P9,p10 and p11(for reset) in this display. It works fine.
But whenever I put off the working display overnight and next day when I resume
My work , the display doesn’t come on. Then I need to ON/OFF Vin power (+5 V SMPS
Separate) many many times, then after trying many times, one time it may come on.
The time it comes “ON” is never predictable. Sometimes many many ON/OFF only makes it ON. Just after it is OFF , there is no surety it will come ON. Once it is ON , then no issues ,it gets reset from mbed button.
Also I noted that evenif I reset the mbed button during the problem times, then also it doesn’t come on for first time. Once it comes ON , then it behaves normal.
Is it any reset issue or my display has developed some problems. I don’t have a spare.
Thanks
Antony
Stephane,
Thanks for above information. I have used your library for some touch panel
buttons. It is useful.
But I have been facing a problem which is quite ununderstantable to me. I am using
P9,p10 and p11(for reset) in this display. It works fine.
But whenever I put off the working display overnight and next day when I resume
My work , the display doesn’t come on. Then I need to ON/OFF Vin power (+5 V SMPS
Separate) many many times, then after trying many times, one time it may come on.
The time it comes “ON” is never predictable. Sometimes many many ON/OFF only makes it ON. Just after it is OFF , there is no surety it will come ON. Once it is ON , then no issues ,it gets reset from mbed button.
Also I noted that evenif I reset the mbed button during the problem times, then also it doesn’t come on for first time. Once it comes ON , then it behaves normal.
Is it any reset issue or my display has developed some problems. I don’t have a spare.
Thanks
Antony
Hello,
sorry to hear that. Are you sure of the 5V and current value of your external power source ? I had screen erratic behaviour because there was not enough current to power it correctly.
Cheers
Hello,
sorry to hear that. Are you sure of the 5V and current value of your external power source ? I had screen erratic behaviour because there was not enough current to power it correctly.
Cheers
Hello Stephane,
Thanks for your lib: this is a nice first step for my new mbed.
I am in trouble with the delays in writeBYTE (1ms) and in the write command ( while (!_cmd.readable()) wait_ms(TEMPO);). The technical documenation of 4D is pretty clear: theses delays are not needed. I tried to remove the delays ... without success. Why ? I do not know.
Then I wrote my own programs...without any delay.(not yet published but running )
When you check the ACK/NAK you have to abort or reset the display if the answer is different from ACK! This is needed because the wohle comunication is disturbed.
Cheers
Robert
Hello Stephane,
Thanks for your lib: this is a nice first step for my new mbed.
I am in trouble with the delays in writeBYTE (1ms) and in the write command ( while (!_cmd.readable()) wait_ms(TEMPO);). The technical documenation of 4D is pretty clear: theses delays are not needed. I tried to remove the delays ... without success. Why ? I do not know.\\
Then I wrote my own programs...without any delay.(not yet published but running ) \\
When you check the ACK/NAK you have to abort or reset the display if the answer is different from ACK! This is needed because the wohle comunication is disturbed.\\
Cheers
Robert
Hey I recently bought a new GREAT serial LCD board for development, like the LCD mentioned here, it just need TX and RX, and it have a plus, could be mounted on a standard breadboard to easy connect our mbeds! and the format it use is FAT(windows), 4D need strange formatting(I have test it), VERY EASY!
Hey I recently bought a new GREAT serial LCD board for development, like the LCD mentioned here, it just need TX and RX, and it have a plus, could be mounted on a standard breadboard to easy connect our mbeds! and the format it use is FAT(windows), 4D need strange formatting(I have test it), VERY EASY!
Check out also the videos!!!
Check out more here:
http://mbed.org/cookbook/SMARTGPU
Please login to post comments.