Just did some more testing with some new code to test without going through SimConnect and Simulator. Makes it easier to setup the test environment.
That means instead of sending an event via SimConnect, and receiving the changed value through a subscribed variable, the encoder callback functions, now update the local variables directly.
Now, I can reproduce the effect more easily and consistently.
Some background info:
As you can identify from the picture below, there are six values displayed on the MCP: Course1, Speed, Heading, Altitude, Vertical Speed and Course2. They are displayed by 3 daisy chained MAX7219 display drivers, each with 2 values from left to right.
Driver 1 drives 'Course1' and 'Speed', driver 2 drives 'Heading' and 'Altitude' and driver 3 drives 'Vertical Speed' and 'Course2'.
I can switch repeatedly between setting 'Heading' and 'Altitude' values, and I will not experience any lag. The same is true if switching between setting 'Vertical Speed' and 'Course2' and if switching between setting 'Course1' and 'Speed'. So as long as I stay with values controlled by the same driver no lag occures.
When I switch from setting e.g. 'Altitude' and then setting 'Course1', there will be a lag, sometimes just 1 second, sometimes up to 6 seconds. I'm sure the lag is only observable when switching between values under the control of different drivers.
Now, as I have been reading the MAX7219 specs when designing my MCP, I know that when one is updating just one chained driver you need to send NoOP instructions for the remaining drivers in the chain. I would not be surprised if those NoOP instructions are not properly managed when switching between updating different drivers. That could explain the observable lag.
I hope we are now closing in on the issue. Looks like we are on the "FAF". If necessary we can do another debugging session next Friday.
Paul
7-Segment displays sometimes lagging badly
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: 7-Segment displays sometimes lagging badly
HI Paul, the NOP - or lack of - is certainly a definite culprit. Well spotted.
I think in a lot of cases the whole chain is written at a single time, which is certainly not efficient.
Out of interest, what size displays are you using as they look very well sized and scaled to the panel. Are they 0.36 ?
Joe.
I think in a lot of cases the whole chain is written at a single time, which is certainly not efficient.
Out of interest, what size displays are you using as they look very well sized and scaled to the panel. Are they 0.36 ?
Joe.
Joe. CISSP, MSc.
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: 7-Segment displays sometimes lagging badly
All front panel components, with exception of the encoders, are original components used by OpenCockpits for their MCP v1. Today they are using different components for their v3 MCP.
The 7-segments digits are yellow 7.6 mm (0.3 inch) micro bright LED, made by AVAGO as type HDSP-7403.
The MCP just displays reference values. So the displays change only when the values are set manually (selected) or by the FMC when following the flight plan (managed). So efficiency is not the main concern for my application.
Paul
The 7-segments digits are yellow 7.6 mm (0.3 inch) micro bright LED, made by AVAGO as type HDSP-7403.
The MCP just displays reference values. So the displays change only when the values are set manually (selected) or by the FMC when following the flight plan (managed). So efficiency is not the main concern for my application.
Paul
Re: 7-Segment displays sometimes lagging badly
Hi,
Thanks for the information, that helps me in where the problem might be.
The code is structured in such a way that it tries to combine messages as much as possible.
NOP's are used off course, otherwise it wouldn't work
We can have a look next Friday. Before that time, I'll go throught he code critical if I can find a possible issue.
Corjan
Thanks for the information, that helps me in where the problem might be.
The code is structured in such a way that it tries to combine messages as much as possible.
NOP's are used off course, otherwise it wouldn't work
We can have a look next Friday. Before that time, I'll go throught he code critical if I can find a possible issue.
Corjan
-
- Posts: 236
- Joined: Sun Feb 14, 2021 6:55 pm
Re: 7-Segment displays sometimes lagging badly
OK, I will prepare for the same time on Friday.
Paul
Paul