Arduino Forum

Using Arduino => Programming Questions => Topic started by: Steve-SFX on Dec 18, 2018, 05:10 pm

Title: Speed issue with 0.96" screen
Post by: Steve-SFX on Dec 18, 2018, 05:10 pm
Hello

I have a small project that uses an I2c 0.96" OLED screen and an MPU6050 gyro.
The Gryo reports back values and displays them on the screen.

My first build of this project using a Pro-mini works fine.

I just replicated the project, uploaded the code and it runs madly laggy.  The graphics are drawing slowly.
I checked all connections.... all good.

Removing the MPU6050 from the I2c bus doesn't change the result.

In my mind, this must be a library thing?   The only difference I can think of is this module was programmed from a different IDE to the other working model.

I have swapped out the Pro-mins, and they are the same Mhz etc.

Its using the SSD1306 library.  Is there anything you can think of that would make one run slower than the other?

Could it even be the screen?  I don't think it is, but I suppose anything is possible.

I am on the phone at the moment, but code can follow...  but in theory, the code is identical, so I ma not sure why one runs at a different speed to the other.

Thanks
Title: Re: Speed issue with 0.96" screen
Post by: UKHeliBob on Dec 18, 2018, 05:15 pm
Seeing the code would be helpful
Title: Re: Speed issue with 0.96" screen
Post by: sterretje on Dec 18, 2018, 06:07 pm
Quote
I have swapped out the Pro-mins, and they are the same Mhz etc.
You mean that the one of the fast project went into the slow project and vice versa and the fast one stayed fast and the slow one stayed slow?

If so, ignore below.

Quote
I just replicated the project, uploaded the code and it runs madly laggy.  The graphics are drawing slowly.
How? Same IDE version? Same board manager version? Same libraries and library versions?


You might want to 'pull' the hex code from the properly working pro-mini using avrdude and a ICSP programmer (assuming you have not protected it) and use avrdude to program it in your replica pro-mini.
Title: Re: Speed issue with 0.96" screen
Post by: Steve-SFX on Dec 18, 2018, 06:12 pm
OK.. didn't realise there would be so many possible variations from one PC to the other.

I programmed the original on my home laptop.  Same IDE (latest version), and pretty sure all the libraries are the same.  I update them all regularly.

I briefly ran through the start-up and disabled all other inputs/outputs to the board, just to make sure there were no conflicts.  No different.

Wondering if its the GFX library?

No idea how to pull the code back off the Pro with an ICSP programmer... and I don't have one anyway!

Title: Re: Speed issue with 0.96" screen
Post by: GypsumFantastic on Dec 18, 2018, 06:14 pm
You can't pull a sketch back off a board. Not in a useful way anyway.

Show us whatever sketch (.ino file) you compiled and uploaded that's giving the laggy behaviour.
Title: Re: Speed issue with 0.96" screen
Post by: sterretje on Dec 18, 2018, 06:18 pm
You can't pull a sketch back off a board. Not in a useful way anyway.
For replication, it's useful.
Title: Re: Speed issue with 0.96" screen
Post by: Steve-SFX on Dec 18, 2018, 06:45 pm
Well tomorrow I will swap the screen to the known working one and swap the MPU6050, just to eliminate those.

Title: Re: Speed issue with 0.96" screen
Post by: Steve-SFX on Dec 19, 2018, 10:49 am
Rolled the SSD1306 driver back a version and its fixed it
 :o
Title: Re: Speed issue with 0.96" screen
Post by: sterretje on Dec 19, 2018, 11:59 am
Newer is not always better :)