I am trying to run on a 1284p a piece of code that has been consistently running fine on a 644p (for the moment not taking advantage of the extra memory ; and no plan to use Timer3). I get two kinds of problems:
- infrequent freezes or crashes after extended periods of use.
- a problem that I am currently working on isolating from my code, and which amounts to short glitches in the PWM output, the value of which is updated from the timer 1 overflow interrupt. To give you an idea of the kind of weirdness I have to deal with, the glitch disappears when I comment a call to a function, but is still there when I comment the body of the function (in which case it's just compiled into a call and a ret).
I am comparing the assembly listings of the code generated by gcc for both targets and the only difference I can see is the extra push/pop in interrupt handlers for saving the content of the rampz register. Besides that the generated code is exactly the same. I'm swapping chips in and out of the same prototype board, fuses are set similarly for both chips.
What could explain the different behaviour? My code hitting an undefined behaviour that goes unnoticed on the 644p but causes havoc on the 1284p? Is there any new "feature" of the 1284p that needs special handling? Any known 1284p oddities? I've tried scanning the datasheets of the 644p and 1284p side by side to look for obvious differences and things that would need to be done differently, but I haven't caught anything besides the availability of a fourth timer.