EEVblog Electronics Community Forum

Electronics => Beginners => Topic started by: ESXi on August 27, 2018, 07:55:34 pm

Title: Arduino compatibility problem
Post by: ESXi on August 27, 2018, 07:55:34 pm
Hi,

I was making a project with a gps module and small I2C ssd1306 128x64 oled screen. But the code(NeoSWSerial latest version) doesn't compile on my Arduino Pro Micro AtMega32u4. Also I cannot get the oled screen to work because I am unable to redefine the pins for I2C?

Somebody who knows how to fix this issue? My project is stalled.. Would like to finish it but don't feel like programming a complete library  :palm:
Title: Re: Arduino compatibility problem
Post by: sentry on August 27, 2018, 08:33:23 pm
Why do you want to redefine the pins for SCL and SDA? I’m pretty sure you can’t. On the ATMega32u4 chip they are wired to D2 (SDA) and D3 (SCL).
Title: Re: Arduino compatibility problem
Post by: ESXi on August 28, 2018, 10:53:05 am
Why do you want to redefine the pins for SCL and SDA? I’m pretty sure you can’t. On the ATMega32u4 chip they are wired to D2 (SDA) and D3 (SCL).

I have tried that, but I also could not get the display to work somehow. I tried to solder of the "Pro" board and guess what, I ended up destroying the prototype board and the pro micro because i soldered all pins and I also found out that the "guutwick, 3.0mm 1.5m" that I ordered kinda sucks compared to my previous solder wick so ...
Now using a Nano v3, everything works like it should. The only weird thing now is that it gets a fix REALLY slow. Maybe because it's cloudy outside, I don't know. My phone's gps gets a fix within seconds.

When I go outside and connect my Nano V3 with OTG to my phone I can see the serial monitor output, I am tweaking some code now. But at least the display and gps module work.
Ordered a few other, I might have damaged my gps module while taking it off. I touched up the U-BLOX module with my beveled soldering tip and added some solder because I wasn't sure why it was not getting a proper fix and not showing me the utc gps date and time on the display that it did the day before on the Uno.

Thing is NeoSWSerial is not compatible with the Pro Micro(because of a missing timer or timer type and interrupt thing), and also when changing ssd1306_i2c_conf.h It did do nothing (black screen). Haven't tried Adafruit lib but made my code using ssd1306_i2c, so didn't want to throw that away.

Clouds just cleared up a little bit and the device works properly again. Conclusion, it was poor gps reception, so the antenna is kinda bad?

(https://i.imgur.com/P5MGrHo.png) (https://i.imgur.com/nD1XTVW.jpg)
(https://i.imgur.com/zkbB0gq.png) (https://i.imgur.com/yHZcW6S.jpg)
Title: Re: Arduino compatibility problem
Post by: rjp on August 28, 2018, 11:04:50 am
GPS needs to keep some data in memory (ephimerides) so it can lock on quickly.

if you completely remove power from the unit it needs to update that information slowly - unfortunately the cheap breakouts dont expose the battery backup pin
Title: Re: Arduino compatibility problem
Post by: ESXi on August 28, 2018, 11:34:15 am
GPS needs to keep some data in memory (ephimerides) so it can lock on quickly.

if you completely remove power from the unit it needs to update that information slowly - unfortunately the cheap breakouts dont expose the battery backup pin

The Neo6MV2 does have a backup battery. But thanks for the information, didn't know that.
Title: Re: Arduino compatibility problem
Post by: ESXi on August 28, 2018, 05:29:24 pm
For god sake.. Adafruit_SSD1306 does not work out of the box, I changed the header file to match my oled screen. 128x64. But still nothing..
The other library that I am using is really poor documented. I don't know how the functions should look like so I took some code from the demo but its garbage..

I am trying to make a canvas or filled box that I can control the width of so I can control it. Like a progress bar, but for the speed indication.
So far everything else works.

What I am looking for is a example or documented file that shows me how I should use the functions like;

uint8_t buffer[128*64/8]; // 1024
NanoCanvas canvas(128,64, buffer); // 64,16,
canvas.fillRect(?, ?, ?, ?, fill color?); // ???
canvas.blt(ssd1306_displayWidth, ?); // ??
Title: Re: Arduino compatibility problem
Post by: doobedoobedo on August 30, 2018, 06:28:20 pm
Check out u8_glib. It drives SSD1306 screens really well, is well documented and easy to use.