I have tried that in the past of course. The DIP 1284P suffers from a hardware bug when running at 20 MHz and when the UART0 is used, causing random memory corruption. It’s documented in a few places and regularly pops up on AVR freaks. Some tricks have been suggested (low-pass filtering the signal getting into the UART) but the problem does not entirely disappear - crashes every 20 or 30 hours of use - and of course it’s no longer a “drop in” replacement since it requires a modification of the digital control board. No go for me.
Well the forum post above says you can “fix” it with some additional components. But such fixes may or may not work depending how you are using the chip.
The last thing you want on a kit is to have to instruct people to solder components on the surface of the board across tracks.
If I’m bored enough some day I may give it a go and see if it works.
Actually, it seems that some 644s also has this issue but to a much lesser extent. I have a contraption on a breadboard that consistently crashed when receiving MIDI input until I put a lowpass filter on it… (same circuit worked perfectly with a 328 MCU).
Yes, the ATMega644p is prone to the same problem to a much, much, much lesser extent. It appears once in a while (due to tolerance excursions in chips and PCB resistance / capacitance) - in this case I suggest replacing the optocoupler by a slower one which produces soft edges (6N138).
The filter did not entirely get rid of the problem for me. I got a MIDI monitor tool running for a whole day before it crashed [vs a few minutes without the fix].
Wouldn’t another option for nicoo be to clock it at 16Mhz?
If it’s for midi operation, I don’t think it’s much of a trouble. I remember reading pichenettes say that the 16 Mhz thing solved the issue.
@6581punk : I have made some tests last night with using a 15MHz (no 16Mhz crystal in spare at home) instead of the 20Mhz crystal.
And, hapiness! with a flood of Midi message and clock event thru the 2 UART, no crash
So thank you again for the information, during some week I thought the problem came from my firmware,
now I ready to jam with my midi box…