GraphCreator in simulation not working

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

I'm now working with the simulation of GraphCreator with a Grove Display.
Somehow I'm doing something wrong. The display shows only the empty graph. I suspect I can not properly set foreground and background.
Also I do not understand the Plotindex so exactly 0-7
graphCreator1.PNG
(15.18 KiB) Downloaded 5489 times
graphCreator2.PNG
(20.16 KiB) Downloaded 5489 times
FC8_2018_icsp1_test_1.fcfx
(20.7 KiB) Downloaded 242 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hello,

It looks like the graph drawer component currently only works with colour displays. With your mono display I got a black box but with a colour display it correctly plotted a line.

I'll see if I can make it play nice with the mono displays too.


The Index parameter for the AddPoint macro should be 0 as you are only drawing a single plot.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

or I take a color display .... :)

I testet the simulation and it's working nice.

But on this occasion I would like to ask you if in the future also a bargraph would be possible?
Bargraph.PNG
(67.93 KiB) Downloaded 5479 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

I found a color Display. It's working with FC8.

Hmmm The text is a little special. I
it should be red and

Hello
200



https://www.mikroe.com/oled-c-click

oled_ssd1351.jpg
oled_ssd1351.jpg (119.77 KiB) Viewed 10178 times

lonsterri
Posts: 1
Joined: Fri Nov 02, 2018 4:00 pm
Contact:

Re: GraphCreator in simulation not working

Post by lonsterri »

Thanks for the link.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hello,
Hmmm The text is a little special.
This is one of the downsides in making the display driver chips so flexible that they can run in many different configurations. We might be able to add a new component property to allow the initialise to startup with an alternative scan direction to fix the issue. Let me know if this would be of interest and I'll have a go for you.

The bit at the top looks uninitialised, maybe try swapping your width/height pixel counts or checking they are correct for the display?

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

I will use the display. It is very fast and you can comfortably program the graphics with FC8. I have already written a part to make a bargraph. This is because the bars look mirrored good ....
As if you could still turn the characters then that would be great.
The weird pixels are gone since I defined the 96x96 pixel display as 128x128 pixels. Even the colors red and green are only interchangeable.
Attachments
display.jpg
display.jpg (190.07 KiB) Viewed 10081 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

The display is working with this Bar.
"component" texfield is showing some letter(like mirror)
If I use the Graph creater the simulation is working but I can not compile to hex.
some errors. I think they are not the problem.....

error_graph.PNG
(26.13 KiB) Downloaded 5242 times

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

i have still the letters in mirror on the display.

I do not know exactly, if you are still looking at it.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hello,

I've pushed a new version of the SSD1351 component to the update system which give you two new properties to allow you to independently Flip the horizontal and vertical. Please can you test them both and see that they do what's expected of them. They shouldn't effect the simulation at all.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

Very well. The font is now readable
The colors are still changed. Green is fine, but red and blue are exchanged. There is a command to swap RGB in BGR. Maybe you can integrate that too? My bars from the bargraph, now come from top to bottom. I can change that in my software.
A little bit of trouble is still the Graphcreator. In the simulation it's, compile to C is ok, but if I compile to hex, It' gives a lot of errors.

And one more question about the SPI. The interface is now running at 2.2Mhz clock. But that could make the Hardware SPI much faster from the PIC32MZ. Is that a big problem to use the SPI hardware or make the current SPI faster?

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hello,

I've pushed a new version with a new colour flip property.

I've also pushed a second SSD1351 component which uses SPI rather than bit banging the communications. SPI will certainly run faster but is more awkward as you have the MISO pin which will be used by the peripheral but won't do anything useful so you basically loose a I/O pin.

Let me know how you get on.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

Super. Thank you. The colors are correct now and the bars and text too. With the SPI port from the Display is a very small problem. It can not remap MOSI. But with the SPI Master, remaping works with channel 1 on D3

Display_spi.PNG
(11.69 KiB) Downloaded 4866 times
SPI_Master.PNG
(23.46 KiB) Downloaded 4866 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Aha thanks for letting us know. I have now added the remap pins to the component for you.

The updated component should now be available via the Help -> Check for updates menu.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

The Display is working nice with the SPI at 16MHz. The limit in the pdf is 20Mhz.
I tried with 25Mz but a lot of pixel was wrong.....

So perfect with 16Mhz!

I just do not know why it is then 2 different display in FC8. I can change the display on software spi if it can not be a hardware spi.

gLCD_SSD1351_SPI1 should be called LCD_SSD1351
(Then I do not have to change hundreds of commands) :)
but of course I leave that to you

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hello,
I just do not know why it is then 2 different display in FC8. I can change the display on software spi if it can not be a hardware spi.
The first display component has just SDO and SCK.

The second SPI display component has an additional SDI pin which is unused by the component but is tied to the peripheral.

Having both displays gives you the option of loosing the SDI pin or running slower. Using the SPI version in software mode is likely to be significantly slower than the original and also currently looses the SDI pin.
(Then I do not have to change hundreds of commands) :)
Have you seen the replace functionality that allows you to replace one component with another. It's very useful for things like this.

Here are some steps to follow.

Drag onto the panel the display or component you wish to move to.
Right click the current display component and select Selection -> Replace... from the menu
The new display component should be shown in the list, select the component
The existing component will be replaced with the new component
Delete the additional component you added at the start.

https://www.matrixtsl.com/wiki/index.ph ... nt_Replace

For the replace to work the function names and parameters of both components need to match.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

incredibly brillant!

A click and every line is changed and it works perfect....

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hello,

just so you know I've made some massive changes to the graph creator component to make it much more efficient and to add some more drawing modes. The changes will likely break existing programs as the parameters for the initialise macro have now been moved into properties. Let me know how you get on if you have a go.

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

I inserted the GraphCreater in my program complet new. Its workin very nice with dummy data.
Both is fast the GraphCreater Component and the display Component.
Soon I trie the use real data (ECG) and post it here...

stefan.erni
Valued Contributor
Valued Contributor
Posts: 654
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 182 times
Been thanked: 179 times
Contact:

Re: GraphCreator in simulation not working

Post by stefan.erni »

Hi Ben

It's realy nice to use the GraphCreator with FC8

Here the working ECG Graph.

I have a mp4 video from the scrolling graph but I can not post Videos.....

WP_20190221_14_57_03_Pro_red.jpg
WP_20190221_14_57_03_Pro_red.jpg (201.33 KiB) Viewed 8841 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: GraphCreator in simulation not working

Post by Benj »

Hi Stefan,

Looking really good :D thanks for sharing.

I've been using the graph creator on the audio DSP solution and that's looking very nice too.

Glad you like it. You can always upload videos to YouTube and then attach them to the forums with a link or by embedding the video.

Post Reply