Have to press reset to get Metro Mini to run program.

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Lowry3D
 
Posts: 4
Joined: Sat Aug 14, 2021 5:07 am

Have to press reset to get Metro Mini to run program.

Post by Lowry3D »

I have two separate installations. One using a Metro 328 with a monochrome 1.3" 128x64 oled stemma qt display, and the other using a Metro Mini 328 running the exact same display with the exact same program. When I plug in the Metro 328 the display comes up immediately no problem. When I plug in the Metro mini I have to press the reset button for the display to work.

?????

This doesn't work for my application. Why do I have to press the reset button on the Metro mini 328 while it comes up no problem on the Metro 328?
What can I do??

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Have to press reset to get Metro Mini to run program.

Post by adafruit_support_mike »

That could be a signal timing issue.

The Metro 328 and the Metro Mini use the same microcontroller and most of the same circuit design.

We have seen cases in the past where an OLED couldn’t boot because its internal voltage didn’t have time to stabilize. We modified the OLED design to prevent that a few years ago, though.

For the sake of comparison testing, if you swap the displays, does the problem follow the OLED or does it stay with the Metro Mini?

User avatar
Lowry3D
 
Posts: 4
Joined: Sat Aug 14, 2021 5:07 am

Re: Have to press reset to get Metro Mini to run program.

Post by Lowry3D »

Ack! No luck.
Not only did the display not come up on powerup on the Metro, but when I swapped the display back THAT display didn't come up either! I went backwards!
I do believe it must be some sort of timing problem though.

My full installation is a Metro 328 with a monochrome 1.3" 128x64 oled stemma qt display coupled with an Adafruit SI1145 (not flora) light detector daisy chained using IC2. Using my custom program and the appropriate libraries it reads the SI1145 and displays the results on the display.

I think it is a timing issue. I think the Metro and Metro mini power up and query the IC2 bus before the display and/or SI1145 are ready to give a response.
I think this is why pressing reset works because all the components are now powered up and ready to receive the new query on the IC2 bus.

So now here is the question. Is there a way to have a delay, say 2 seconds, and then force another IC2 query in software? The delay is easy but forcing a read/reset of the IC2 is something I'm unfamiliar with.

Getting interesting!

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Have to press reset to get Metro Mini to run program.

Post by adafruit_support_mike »

Lowry3D wrote:I think it is a timing issue. I think the Metro and Metro mini power up and query the IC2 bus before the display and/or SI1145 are ready to give a response.
That’s entirely possible.
Lowry3D wrote:Is there a way to have a delay, say 2 seconds, and then force another IC2 query in software? The delay is easy but forcing a read/reset of the IC2 is something I'm unfamiliar with.
I2C doesn’t have an official ‘reset the bus’ message, but SMBUS, a derivative of I2C, does. Emit a start condition, then hold SCL high for more than 35ms. Many I2C devices will follw that rule even if they aren’t SMBUS devices.

You should’t need a reset though. No I2C communication happens until you specify it in code, so adding a delay to the top of setup() should give the display enough time to get settled before it sees an I2C message.

User avatar
Lowry3D
 
Posts: 4
Joined: Sat Aug 14, 2021 5:07 am

Re: Have to press reset to get Metro Mini to run program.

Post by Lowry3D »

Yes I came to the same conclusion about placing a delay at the start of the code. I will try it and tell you how it went!

User avatar
Lowry3D
 
Posts: 4
Joined: Sat Aug 14, 2021 5:07 am

Re: Have to press reset to get Metro Mini to run program.

Post by Lowry3D »

Follow-up:
It worked! Delay(1000) right at the beginning of the initial Loop() solved the problem. It probably could be less than 1 second delay but I'm happy.

Thanks for helping! Hope this helps someone else.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: Have to press reset to get Metro Mini to run program.

Post by adafruit_support_mike »

Glad to hear that did the trick. Happy hacking!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”