Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 23:34 24 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Picomite - Save/Capture image

Author Message
Upweywarrior

Newbie

Joined: 22/07/2022
Location: United Kingdom
Posts: 3
Posted: 06:09pm 22 Jul 2022
Copy link to clipboard 
Print this post

Hello all,
So i am looking to screenshot the Graph that Plots my sensor inputs On my PicoMite.

I have a Wav Share 3.5" Eval display hooked up.
I tried to use;
SAVE IMAGE filename$ [, StartX, StartY]

I was unsuccessful using this and was thrown an error After consulting the manual again I discovered that I would need an ILI9341 based LCD screen to use this command.

I however, have a ILI9488/XPT2046 Display    

So my question now is, Is there an Easy way to capture a screenshot whilst using a different display?

My logic tells me i could probably iterate through the pixels individually & log/read there colour value, Then store and format this data into the Structure required for that format. In this case a .BMP image.

I found this command;
PIXEL( x, y [,page_number])
REM - Returns the colour of a pixel on an LCD display.

According to the manual This should be compatible with my display.

So now Im looking for information regarding .BMP file structure/formatting, and advice on writing this captured img data to the SD card.

Any advice or reading material That could help me resolve this predicament would be much appreciated.



Thanks
Robert
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 06:29pm 22 Jul 2022
Copy link to clipboard 
Print this post

Save image works on the ILI9488 IFF you connect the display's MISO pin using a 680 ohm resistor
 
Upweywarrior

Newbie

Joined: 22/07/2022
Location: United Kingdom
Posts: 3
Posted: 07:23pm 22 Jul 2022
Copy link to clipboard 
Print this post

Brilliant, So It just needed extra resistance on GP12 between the two boards?
Like so.
  Quote  [LCD]----{680ohm}----[PI]
[MISO]                    [GP12]

When I'm home later I will give this a go, could you explain in any more detail as to why this is the case?
Does the pi see the added resistance and think its a different display perhaps?
just curious

Thanks
Robert.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 09:22pm 22 Jul 2022
Copy link to clipboard 
Print this post

The MISO pin on the ILI9488 doesn't tri-state properly - it's a fault on the display. If anything else shares that pin then the display will prevent it from working. Using a resistor lets other devices use the pin. 680R is just a value that was found to work.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6097
Posted: 09:23pm 22 Jul 2022
Copy link to clipboard 
Print this post

  Upweywarrior said  
When I'm home later I will give this a go, could you explain in any more detail as to why this is the case?
Does the pi see the added resistance and think its a different display perhaps?
just curious

Thanks
Robert.

To get the data from the display, you need the data line that goes from display to controller connected. Without that, you can only send data TO the display.
Why they put out display modules without both data lines is anyone's guess.

Jim
VK7JH
MMedit   MMBasic Help
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 09:40pm 22 Jul 2022
Copy link to clipboard 
Print this post

"Why they put out display modules without both data lines is anyone's guess."

The ILI9488 controller chip MISO output is defective, unable to go tri-state preventing use of touch and SD on the same SPI. On some displays WaveShare have left that pin disconnected. Touch and SD can however cope with a 680R load so it is possible to make it work, provided there is a track from the ILI9488 chip to the header pin.
 
vegipete

Guru

Joined: 29/01/2013
Location: Canada
Posts: 1109
Posted: 01:18am 23 Jul 2022
Copy link to clipboard 
Print this post

  Upweywarrior said  Hello all,
So i am looking to screenshot the Graph that Plots my sensor inputs On my PicoMite.

Your program generates the plots, so your program can also decide how to save the data that generated the plots. Then a companion program, perhaps running on MMB4W, can read that data and generate a new, copy-able plot. Or write a data file that can be fed into Excel for graphing.
Visit Vegipete's *Mite Library for cool programs.
 
Upweywarrior

Newbie

Joined: 22/07/2022
Location: United Kingdom
Posts: 3
Posted: 02:03pm 23 Jul 2022
Copy link to clipboard 
Print this post

Thanks for your help so far,

Here are some more details for my display.


Option SPI GP10,GP11,GP12
Option Touch GP16,GP17
Option SDCARD GP22,GP5,GP18,GP19
Option LCDPanel ILI9488w, Rlandscape, GP8,GP15,GP9,GP13


Under the Display documents it says "Controller: ILI9488/XPT2046"
Display Documents

My option for LCDpanel is ILI9488W
because i am using the Waveshare 3.5" eval board)

According to the manual, Both The ILI9488W & ILI9488 Initialises a TFT display using the ILI9488 controller.

Could anyone explain the difference between the two and is it possible to use the 680R Mod/Fix with my display If i was to change my option settings to;
Option LCDPanel ILI9488, Rlandscape, GP8,GP15,GP9,GP13

(removed the "W")

And then added a 680R in series on my MISO line(GP12), Would this Fix The "Get colour of Pixel" command & the "Save image" command errors?

Sorry for all the questions,
I'm still learning.

Thanks
Robert.
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 03:25pm 23 Jul 2022
Copy link to clipboard 
Print this post

MISO is a signal from the display to the Pico. It's needed to read data back from the display.

The MISO pin on the ILI9488W works as intended, so the series resistor isn't needed.
It's the MISO pin on the ILI9488 that is faulty. That signal comes from the ILI9488 chip, so it appears that there is a faulty production run.

I'm assuming that there must be a difference in the configuration routines, otherwise there would only be one driver. :) It may be checking for a MISO signal)

Note that if nothing else is connected to the MISO pin (Touch data or a SD card for example) then the 680R resistor isn't needed for either display. It's just that the ILI9488 won't tri-state the pin to let another device use it.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9110
Posted: 03:57pm 23 Jul 2022
Copy link to clipboard 
Print this post

  Quote  The MISO pin on the ILI9488W works as intended, so the series resistor isn't needed.


WRONG.
The 3.5" Waveshare ILI9488 is wired parallel with external shift registers and there is absolutely no way to read the framebuffer. Therefore BLIT, the PIXEL function and SAVE IMAGE can't work on this display.

The displays which work are ILI9341, ILI9481 (with 680ohm resistor - NB: type in my post above), ST7789_320 and all the mono and SSD1963 displays
Edited 2022-07-24 01:57 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 04:10pm 23 Jul 2022
Copy link to clipboard 
Print this post

That should perhaps be made a little clearer in the manual, Peter. When comparing the ILI9488 and ILI9488W there it is only indicated that the ILI9488 has a MISO problem. Perhaps the section should start with a statement that only a few, indicated, displays can be read by the PicoMite.
Edited 2022-07-24 02:12 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
DaveJacko
Regular Member

Joined: 25/07/2019
Location: United Kingdom
Posts: 76
Posted: 09:02pm 23 Jul 2022
Copy link to clipboard 
Print this post

Have a look at GFXterm by our very own Robert Rozee.

This simple program allows a Micromite, Picomite, (or anything with RS232)
to plot directly to the PC screen, where it can be screenshotted if needed.
and it's a nice terminal for programming too.

BTW, upwey, project sounds interesting, can you tell us more?
 
LewW
Newbie

Joined: 16/01/2018
Location: Australia
Posts: 15
Posted: 01:18am 17 Aug 2024
Copy link to clipboard 
Print this post

Hi all,

I'm really interested in using SAVE IMAGE with the Picomite backpack, and I'm currently using the ILI9488 display.  

If I understand correctly (i.e., assuming that Matherp's "type" in his second post was meant to be "typo"), SAVE IMAGE will not work with the ILI9488 displays even with the MISO pin connected or connected via 680 Ohms).   Is that right?  

Also, if I understand correctly, SAVE IMAGE will work with the ILI9481 display if the MISO pin is connected via 680 Ohms.  Is that right?

Are there any disadvantages in using an ILI9481 display instead of an ILI9488 display with the Picomite backpack?

I will be grateful for any clarification.

Lew.

PS I know that connecting the MISO pin with the ILI9488 will compromise the Touch function, but I would only connect it when I want to save an image.   I could live with that!
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 02:21am 17 Aug 2024
Copy link to clipboard 
Print this post

The 680Ω trick is unreliable if touch and SD card are also connected to MISO on the Pico.
A better method for a 3.5" TFT ILI8488 is a 1N5819 or 1N4004 diode connected from LCD_SDO to Pico MISO and a 1.8kΩ to 10kΩ resistor from LCD_CS to MISO. This allows touch and SD card to work properly.
Scroll down in this thread
For a 4" IPS ILI8488 the resistor must be 1.8k as there is a 4.7k pullup on SD_DO.
Also the 4" IPS panel must only be supplied with 3.3V as the voltage regulator isn't installed.

You can test if the screen is being read properly with this:-
> clear : dim a$(2)=(" Blues"," Greens"," Reds") : dim integer b, c, n
> for b=0 to 2:n=0:for c=0 to 255:pixel 9,9,c<<b*8:if pixel(9,9)=c<<b*8 then:inc n:endif:next:?n;a$(b):next
64 Blues
64 Greens
64 Reds
the code window has broken the second line, it needs to be one line.

for b=0 to 2:n=0:for c=0 to 255:pixel 9,9,c<<b*8:if pixel(9,9)=c<<b*8 then:inc n:endif:next:?n;a$(b):next
Edited 2024-08-17 12:39 by phil99
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6780
Posted: 07:35am 17 Aug 2024
Copy link to clipboard 
Print this post

The ILI9481 can be regarded as the "standard" LCD TFT display. Everything works properly on it.

The ILI9488 has a silicon bug. Normally, if MISO is connected like a ILI9481, the touch controller attempts to send data at the same time as the display, so the advice used to be to leave MISO disconnected. That prevented the data clash but also meant that you couldn't read data back from the LCD. The current hacks with a resistors and sometimes a diode are attempts to get round the problem. The 680R resistor simply current limits MISO so that the clash doesn't matter. The resistor/diode form a gate. Ultimately though, the ILI9488 has been faulty from the start and almost certainly won't get fixed. It's not the ideal choice for a display.

There is also a ILI9488W. This isn't a ILI9488, it is write-only. It is always impossible to read from this display.

.
Edited 2024-08-17 17:42 by Mixtel90
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2135
Posted: 07:52am 17 Aug 2024
Copy link to clipboard 
Print this post

If you already have the ILI9488 it isn't hard to make it work properly.
To avoid modifying your PCB the diode and resistor can be added to the top of the header on the ILI8488.
As T_DO connects to Pico MISO connect the diode anode to LCD_SDO and cathode to T_DO and the resistor from LCD_CS to T_DO.
If the PCB has a track from MISO to LCD_SDO snip the SDO pin off the display header.
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024