Go Down

Topic: Speed issue with 0.96" screen (Read 178 times) previous topic - next topic

Steve-SFX

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

UKHeliBob

Seeing the code would be helpful
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

sterretje

#2
Dec 18, 2018, 06:07 pm Last Edit: Dec 18, 2018, 06:09 pm by sterretje
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.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Steve-SFX

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!


GypsumFantastic

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.

sterretje

You can't pull a sketch back off a board. Not in a useful way anyway.
For replication, it's useful.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Steve-SFX

Well tomorrow I will swap the screen to the known working one and swap the MPU6050, just to eliminate those.


Steve-SFX

Rolled the SSD1306 driver back a version and its fixed it
 :o

sterretje

If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Go Up