Hi,
I have arduino uno replica which I've built by myself which I'm using for some long running projects so I implemented a function to go through the eeprom from beginning to end and record the value of each sector and then change the value to some random and then write the original value back.
I first started noticing that it crashed the board randomly(could also be coincidence and some other culprit) and then I noticed that when I have FM radio on, the eeprom write causes extremely strong interference while that function is running even though the radio & antenna are over 5 meters apart. Is this normal and any ideas on how to fix this?
Lorvija:
I first started noticing that it crashed the board randomly
The datasheet says (in the section "Preventing EEPROM corruption"):
During periods of low VCC, the EEPROM data can be corrupted because the supply voltage is too low for the CPU and the EEPROM to operate properly. These issues are the same as for board level systems using EEPROM, and the same design solutions should be applied. An EEPROM data corruption can be caused by two situations when the voltage is too low. First, a regular write sequence to the EEPROM requires a minimum voltage to operate correctly. Secondly, the CPU itself can execute instructions incorrectly, if the supply voltage is too low.
CrossRoads:
Any particular frequency, or all stations?
How about other things, like an SPI write?
Hmm didn't even think it could be so specific. But yeah the interference occurs on station 97.30Mhz but on 90.00 or 105.00 or 99.70 or 97.70 there's nothing. That 97.30 is a bit weak so that might be one of the reasons it's the only one showing that problem.
If I use atmels AVR programmer there's slight interference (i can still hear the music) when it's writing and HUGE spike (kills the sound from radio completely) when the thing boots.
@fungus, yeah I got decoupling capacitors on the power pins. Also the board just restarts, no data has been lost or anything. And it restarts after the write, not during it so might have been just an issue with watchdog or other coding problem done by me.
Any mcu is a generator of a broad frequency spectra, from Hz to GHz. When the whole system is not enclosed into a shielding, good decoupled, and ANY wire coming out of the shielding is not filtered enough, it will create EMI. That is normal. To get rid of such EMI is difficult. I would recommend you to switch off your FM receiver while working with arduino :), or, use an external antenna, placed far away from your arduino (and fed with coax into your receiver)..
Are you sure the radio is switched to FM? Usually, interference shows up on AM bands.
I first started noticing that it crashed the board randomly
This does sound like a power supply problem. I2C eeprom chips don't draw much current
when accessing them. Sounds like there is some fundamental electrical problem on your
"arduino uno replica which I've built by myself".