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

stefan.erni
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

GraphCreator in simulation not working

Postby stefan.erni » Thu Nov 01, 2018 10:17 am

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
graphCreator1.PNG (15.19 KiB) Viewed 3569 times


graphCreator2.PNG
graphCreator2.PNG (20.17 KiB) Viewed 3569 times


FC8_2018_icsp1_test_1.fcfx
(20.7 KiB) Downloaded 46 times

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

Re: GraphCreator in simulation not working

Postby Benj » Thu Nov 01, 2018 1:28 pm

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
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Thu Nov 01, 2018 2:42 pm

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
Bargraph.PNG (67.93 KiB) Viewed 3559 times
These users thanked the author stefan.erni for the post:
Benj (Fri Nov 02, 2018 2:29 pm)
Rating: 5.56%
 

stefan.erni
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Tue Nov 06, 2018 1:04 pm

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.78 KiB) Viewed 3479 times
These users thanked the author stefan.erni for the post:
Benj (Mon Nov 12, 2018 3:59 pm)
Rating: 5.56%
 

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

Re: GraphCreator in simulation not working

Postby lonsterri » Sun Nov 11, 2018 5:33 am

Thanks for the link.

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

Re: GraphCreator in simulation not working

Postby Benj » Mon Nov 12, 2018 4:00 pm

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
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Mon Nov 12, 2018 4:38 pm

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 3382 times
These users thanked the author stefan.erni for the post:
Benj (Mon Nov 12, 2018 5:11 pm)
Rating: 5.56%
 

stefan.erni
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Thu Nov 15, 2018 9:23 am

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
error_graph.PNG (26.14 KiB) Viewed 3322 times

stefan.erni
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Fri Nov 30, 2018 11:45 am

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: 14157
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: GraphCreator in simulation not working

Postby Benj » Fri Nov 30, 2018 6:01 pm

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
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Mon Dec 03, 2018 11:44 am

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: 14157
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: GraphCreator in simulation not working

Postby Benj » Mon Dec 03, 2018 6:15 pm

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
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Tue Dec 04, 2018 9:20 am

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
Display_spi.PNG (11.69 KiB) Viewed 2946 times


SPI_Master.PNG
SPI_Master.PNG (23.46 KiB) Viewed 2946 times

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

Re: GraphCreator in simulation not working

Postby Benj » Wed Dec 05, 2018 11:14 am

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
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Wed Dec 05, 2018 3:21 pm

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: 14157
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4080 times
Contact:

Re: GraphCreator in simulation not working

Postby Benj » Wed Dec 05, 2018 5:53 pm

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.
These users thanked the author Benj for the post:
petesmart (Wed Dec 05, 2018 8:32 pm)
Rating: 5.56%
 

stefan.erni
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Thu Dec 06, 2018 9:46 am

Hi Ben

incredibly brillant!

A click and every line is changed and it works perfect....
These users thanked the author stefan.erni for the post:
Benj (Thu Dec 06, 2018 2:35 pm)
Rating: 5.56%
 

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

Re: GraphCreator in simulation not working

Postby Benj » Mon Feb 18, 2019 6:44 pm

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
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Wed Feb 20, 2019 11:27 am

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...
These users thanked the author stefan.erni for the post:
Benj (Wed Feb 20, 2019 3:36 pm)
Rating: 5.56%
 

stefan.erni
Posts: 496
Joined: Fri Aug 19, 2016 2:09 pm
Location: switzerland
Has thanked: 157 times
Been thanked: 143 times
Contact:

Re: GraphCreator in simulation not working

Postby stefan.erni » Thu Feb 21, 2019 4:53 pm

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 2142 times
These users thanked the author stefan.erni for the post:
Benj (Fri Feb 22, 2019 10:41 am)
Rating: 5.56%
 

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

Re: GraphCreator in simulation not working

Postby Benj » Fri Feb 22, 2019 10:43 am

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.