Go Down

Topic: Arduino stop executing the sketch (Read 2058 times) previous topic - next topic

tuxduino


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...

3mpty

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 :D

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

tuxduino

(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 :-)

3mpty

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

Go Up