Siirry pääsisältöön

Ohjelmointi lajittelematon


Tsekkaa
AVR EEPROM
Refer Atmel page

EEPROM corruption

Question
My EEPROM is sometimes corrupted, what can I do to prevent this?
Answer
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. Second, the CPU itself can execute
instructions incorrectly, if the supply voltage is too low.

EEPROM data corruption can easily be avoided by following this design
recommendation:

Keep the AVR RESET active (low) during periods of insufficient power supply
voltage. This can be done by enabling the internal Brown-out Detector (BOD).
If the detection level of the internal BOD does not match the needed
detection level, an external low VCC Reset Protection circuit can be used.
If a reset occurs while a write operation is in progress, the write
operation will be completed provided that the power supply voltage is
sufficient.

What all this means is: If you can't guarantee power, you have to make sure
that the part is kept in RESET when it is outside of spec. You can do this
using the internal BOD, but this will not take care of the case when an
EEPROM write has already began when the part loses power. Thus you must also
make sure to write to the EEPROM only when you're sure to have power.

It is not enough to write to the EEPROM during "safe periods" and leave the
BOD disabled, though: If the part gets outside spec it can begin executing
erratically, and the program couter could concievably jump to the part in
the code in which the EEPROM is written.

These are not bugs but intrinsic demands of the EEPROM.

Interrupts are not disabled automatically, but the customer is urged to take
care of the following during EEPROM write (the order of steps 3 and 4 is not
essential):

1. Wait until EEWE becomes zero.
2. Wait until SPMEN in SPMCR becomes zero.
3. Write new EEPROM address to EEAR (optional).
4. Write new EEPROM data to EEDR (optional).
5. Write a logical one to the EEMWE bit while writing a zero to EEWE in
EECR.
6. Within four clock cycles after setting EEMWE, write a logical one to
EEWE.

Caution: An interrupt between step 5 and step 6 will make the write cycle
fail, since the EEPROM Master Write Enable will time-out. If an interrupt
routine accessing the EEPROM is interrupting another EEPROM access, the EEAR
or EEDR Register will be modified, causing the interrupted EEPROM access to
fail. It is recommended to have the Global Interrupt Flag cleared during all
the steps to avoid these problems.


AVR rprint f
https://ccrma.stanford.edu/wiki/AVR_Programming
unsigned int a, b;
unsigned long c = (long)a * (long)b;


minGW
Serial port
http://www.codeguru.com/cpp/i-n/network/serialcommunications/article.php/c2503/



FFT

Näyttömoduuli ja softa:
http://www.arduino.cc/playground/Code/GLCDks0108
http://www.pjrc.com/teensy/td_libs_GLCD.html

LCD modules 128x64
http://www.azdisplays.com/index.php?id=Graphic_Modules&product=g1264f
http://www.e-shore.com.my/homepage/eshop/output-modules/lcd/128x64-dots-graphic-lcd

http://www.newhavendisplay.com/specs/NHD-12864WG-BTMI-VN.pdf

Torsional Vibration
http://blog.prosig.com/2006/01/12/torsional-vibration-tacho-pulses-and-aliasing/

Digital Filters

FIR
http://www-users.cs.york.ac.uk/~fisher/mkfilter/
http://www.bores.com/courses/intro/filters/4_freq.htm

Yleistietoa
http://www.fourier-series.com/f-transform/index.html