Pages: 1 [2]   Go Down
Author Topic: Arduino stop executing the sketch  (Read 1751 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One of the principles in debugging is to simplify the code as much as you can to the point that the problem still shows up with the least amount of code.
Take out you security (secret) code and see if the problem still shows. If that's the case, you should be able to post your code at this point.

I second this suggestion. But I'd go even further and write a sketch which would only test the I2C communication...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
If you can dodge a wrench, you can dodge a ball
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok guys, apparently I solved the problem.

I swapped the IC with a brand new one... nothing changed.
I swapped Arduino with an Adweeny... nothing changed.
I swapped both of the... nothing changed.

Then, just for the sake of doing it, I replaced the quartz with a brand new one. Identical. Same batch.
Guess what? Now it seems to work fine smiley-grin

Could someone explain this to a software guy?
Btw, thank you *very much* for your help men, Arduino has a great community.
Logged

Offline Offline
Edison Member
*
Karma: 26
Posts: 1339
You do some programming to solve a problem, and some to solve it in a particular language. (CC2)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

(I'm a sw guy too)

I guess one reason is that if the quartz resonant frequency is too far off the nominal one, then all the timings based on uP clock frequency become wrong, because suddenly 100 instructions do not execute in 100us but (e.g.) in 110us. Small timing errors quickly add up... Also, if a bad-quartz device talks with a good-quartz one I think the signals quickly go out-of-sync.
* tuxduino now waits for hw-guys to provide more in-depth explanations :-)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 11
If you can dodge a wrench, you can dodge a ball
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't know if I am supposed to be happy to have a functional circuit or angry for all the time spent debugging the wrong stuff T.T
Logged

Pages: 1 [2]   Go Up
Jump to: