RoiRomy / minimosd-extra

Automatically exported from code.google.com/p/minimosd-extra
0 stars 0 forks source link

Adding vsync support #132

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.normal use

What is the expected output? What do you see instead?
The OSD shows short horizontal errors (random flickering). The lines with these 
errors move slowly in vertical direction. 

Please provide any additional information below.
The datashet of MAX7456 says:
"Momentary breakup of the OSD image can be prevented by writing to the display 
memory during the vertical blanking interval. This can be achieved by using 
VSYNC as an interrupt to the host processor to initiate writing to the display 
memory." (page 11)
"The display of a character may momentarily appear to
break up if an internal display-memory read request
occurs simultaneously with an SPI display-memory
operation." (page 40)

Exactly this is the reason for the errors. 
The problem is, that spi sending needs about 5 to 8ms and does not fit into the 
vsync intervall.

There are several ways to soften the problem.
-Wait for vsync bevor sending spi data. e.g. by adding the following line bevor 
calling writePanels():
while(digitalRead(MAX7456_VSYNC);
--> the lines with errors do not move arround
-The ideal solution would be to shorten the sendig intervall by buffering the 
complete data bevor sending over spi. The sending intervall could be reduced by 
factor 10 or more
-Additional the data can be splitted and sended at 2 or 3 vsync intervalls

The first solution makes the flickering acceptable, especially if the osd is 
configured, that no data is displayed in the upper 10 to 20% of the screen. 
Then no flicker occurs.

Original issue reported on code.google.com by toni9...@gmail.com on 6 Jun 2015 at 10:40

GoogleCodeExporter commented 8 years ago
Here ist my Version of OSD_Panels.ino for copters.
You can see the syncing and data splitting. 
with this version I get only flickering in the first line and nearly nothing in 
the second one. 

All data packets are shorter than 1ms except the one for setting the horizon. 
But this 3,5ms long packet has a very low data density after the first 
millisecond and causes nearly no errors.

Original comment by toni9...@gmail.com on 6 Jun 2015 at 3:28

Attachments: