EEPROM: duk abin da kuke buƙatar sani game da wannan ƙwaƙwalwar

EEPROM

Idan kai mai kirkira ne kuma kana aiwatar da wasu ayyukan DIY wanda dole ne kayi aiki da ƙwaƙwalwa, tabbas ka riga ka san yadda abubuwan tunani daban-daban da Arduino ke haɗawa da aiki, kamar walƙiya (wanda ba shi da ma'ana inda aka adana zane da bootloader), SRAM (mai saurin walwala da ƙwaƙwalwa inda masu canjin shirye-shirye suka kasance yayin aiki), da EEPROM (wanda ba mai canzawa ba kuma ana iya amfani dashi don adana bayanan sake yi).

Da kyau, ban da EEPROM da aka haɗa a cikin Arduino, zaku iya amfani da kwakwalwan waje na irin wannan ƙwaƙwalwar, ta yaya componentarin ƙari. Ba su da rikitarwa fahimtar, ko mu'amala da su don samar da dama (rubutu da karatu) ko sabunta bayanan da aka adana. Anan zaku sami duk abin da kuke buƙatar sani don fara aiki tare da waɗannan nau'ikan tunanin ...

Menene EEPROM?

STMicroelectronics EEPROM

STMicroelectronics EEPROM

La EEPROM (Prowaƙwalwar Red-Kawai Memorygrammable mai Shiryawa) Nau'in ƙwaƙwalwar ajiyar ROM ce, ma'ana, ƙwaƙwalwar da ba ta canzawa inda za a adana bayanai na dindindin, koda kuwa an cire wutar lantarki. Hakan ya saka su a daya bangaren na RAM (Random Access Memory), wanda ke rasa dukkan bayanan su yayin da ba su da karfi.

A game da EEPROM, ba ƙwaƙwalwa ba ce kamar ROM, wacce a ciki aka rubuta bayanai kuma ba za a sake canza ta ba. EEPROM, kamar walƙiya, yarda da za a canza kamar yadda ake bukata. Wato, ana iya adana wasu bayanan kuma a share su don adana daban-daban.

A zahiri, kamar yadda jimlolin sa suka nuna, shi ne ƙwaƙwalwar ajiyar ƙwaƙwalwa (mai iya sharewa ta lantarki) don sake tsara shirye-shirye. Wannan ya bambanta da sauran nau'ikan ROM, waɗanda suma za'a iya share su kamar EPROMs, amma a wannan yanayin ba a amfani da wutar lantarki don share ƙwayoyin ƙwaƙwalwar ajiya, maimakon haka suna da maɓallin "quartz" na ma'adini akan gutsin ɗin don samun damar aiwatar da hasken UV. da shi aka goge shi.

Wannan halayyar ta EPROM hakan ya basu wahala sosai, kasancewar sun fitar da wadancan hasken don shafe su. Kuma, mafi munin duka, ana iya share su ba zato ba tsammani idan aka fallasa su da irin wannan hasken. A cikin EEPROMs, an ba shi izinin yin hakan ta hanyar ƙazamai, a cikin mafi sauƙi da aminci.

Tsarin ciki

Zane EEPROM

Source: Researchgate.net

Domin EEPROM yayi aiki, ana buƙatar takamaiman ƙwayoyin ƙwaƙwalwar ajiya. An gina su ta amfani da nau'in transistors na MOS, amma suna da ƙofa mai iyo idan aka kwatanta da na MOSFET na gargajiya. Waɗannan sababbin transistors suna bin tsarin da aka sani da SAMUN, kuma yanayinta na yau da kullun yana yankewa kuma fitowar sa koyaushe zata samar da ma'ana 1.

Wadannan kwayoyin EEPROM ana iya karanta su adadi mara iyaka, amma an iyakance shi yawan lokuta za a iya share su kuma a sake tsara su, kamar yadda yake faruwa ga wasu da yawa. Wannan ma yana faruwa da walƙiya, wanda shine dalilin da ya sa aka yi magana mai yawa game da karko na rumbun kwamfutocin SSD, alkalami alkalami, da dai sauransu.

Dangane da SAMOS, wannan iyaka yana tsakanin 100.000 da kuma sau 1.000.000. Bayan haka, za su kasa. Af, wasu sifofi waɗanda tsohuwar ƙawance suka ƙirƙira, ɗayan manyan mutane: Dr. Fujio Masuoka daga Toshiba (1984), wanda kuma ya ƙirƙiri wasu mahimman abubuwan tunani da tsarin ginin semiconductor ... Duk da haka, an ƙaddamar da guntu ta farko akan kasuwa ta Intel ce daga 1988, nau'in NOR EEPROM.

Bugu da kari, dole ne ku sani cewa wannan nau'in ƙwaƙwalwar yana da alaƙa da CPUs ko masu sarrafawa ta hanyar bas tare da ladabi kamar SPI, I2C, da dai sauransu Game da MCUs (microcontrollers), yawanci ana haɗa shi a ciki, kamar yadda yake a cikin wasu DSPs, don samun saurin gudu.

Kamar yadda ake iya gani a hoton da ke sama, da SAMOS masu fassara da ke samar da ƙwayoyin ƙwaƙwalwar ajiya, ana haɗuwa a cikin yanayin a cikin nau'i biyu. Ofaya daga cikin layukan da aka haɗa zuwa ƙofar wasu transistors yana aiki azaman layin zaɓi, don yin alama ko siginar wannan layin don samun dama (karatu da rubutu), ɗayan kuma zai kasance wanda ke adana bayanan bit (0 ko 1).

Masu fassarar suna haɗe don ƙirƙirar tsayin kalmar da ake buƙata (4-bit, 8-bit, 16-bit, ...) da kuma kalmomi da yawa kamar iya aiki kana son samun EEPROM (misali: ana iya samun tsayin kalma 64-bit kuma tare da layi 16 = rago 1024, ma'ana, 1kb).

Ta yaya EERPOM ke aiki?

Kamar yadda kake gani a gefe, don aiwatarwa ayyuka daban-daban, ƙarfin ƙarfin ƙofar ku, tushe da magudanar ruwa dole ne ya zama ɗaya:

  • Kofa a 20v da Drain a 20v = shirye-shirye (rubuce-rubuce) na ƙwaƙwalwar ajiya don adana bit ɗin da ake so.
  • Kofa a 0v da Drain a 20v = share bit din da aka adana ta yadda za'a sake tsara shi da wani darajar.
  • Kofa a 5v da Drain a 5v = karanta bit ɗin da aka adana. Kamar yadda ƙarfin ƙofa yake ƙasa da na rubutu, ƙimar da aka adana ba za a canza ba. Hakanan yana faruwa da ƙarfin magudanar ruwa, kasancewa ƙasa, ba za a share bit ɗin da aka adana ba.

Kammalawa, EEPROMs suna amfani da fewan kaɗan voltages "High" don sharewa da rubutu, yayin amfani da ƙananan ƙa'idojin karatu ...

Sayi EEPROM kuma yi aiki dashi

LMR, kamfanin Faransa mai kera microelectronics, shine na daya a cikin irin wannan kwakwalwan na EEPROM, dukda cewa akwai wasu masana'antun da yawa, kamar Microchip. Wadannan kwakwalwan kwamfuta galibi suna da arha.

Idan ka shawarta zaka yi amfani da ɗayan waɗannan kwakwalwan, ya kamata ka ga masana'anta da samfura ka nemi ta takardar bayanai don ganin duk shawarwarin masana'antun, domin suna iya bambanta daga wannan zuwa wancan. Misali, zasu iya tantance yanayin karfin da yake aiki, da pinout, da dai sauransu Don haka zaku iya saita aikin ku yadda ya kamata.

Ya danganta da girma da samfurin, yana iya samun ƙari ko ƙasa pines. Amma don ba ku ra'ayi, na musamman 24LC512 EEPROM IC guntu, ana iya haɗa shi da:

  • Fil 1 (A0), 2 (A1), da 3 (A3) da aka yi amfani da su a cikin daidaitawar sune maɓallan zaɓi.
  • Pin 4 (Vss / GND) an haɗa shi zuwa ƙasa.
  • Pin 5 (SDA), don bayanan serial don sadarwar I2C.
  • Pin 6 (SCL), don agogo don I2C.
  • Pin 7 (WP), rubuta-kariya ko rubuta kariya. Idan yana haɗe da GND, za a kunna rubutu. Idan ta haɗu da Vcc an kashe ta.
  • Pin 8 (Vcc), an haɗa shi da wuta.

Amma ga Bayani na fasaha wannan guntu:

  • 512K (64 × 8)
  • 128-baiti buffer don rubutu
  • Aiki mai aiki: 1.8v zuwa 5.5v
  • Karatun yanzu: 40uA
  • Motar sadarwa: I2C
  • Rubuta da'ira: 5ms
  • Karfin agogo: 100-400Khz
  • Karkowa: 10.000.000 hawan keke
  • Za'a iya yin kwalliya har zuwa na'urori 8
  • Marufi: pin-8 DIP, SOIJ, SOIC da TSSOP.

Inda zan siya

para sayi kwakwalwan EEPROM, zaku iya duban waɗannan shawarwarin:

Amfani da Arduino EEPROM

Screenshot na Arduino IDE

Idan kana son fara aiki tare da EEPROM, zaka iya gwada wanda ke allon ka Arduino. Ana iya tsara shi ta hanya mai sauƙi don fahimta a matakin ma'ana da shirye-shiryen yadda zata iya aiki.

Misali don adana canji

//Almacenar un valor en la EEPROM
#include <EEPROM.h>
 
float sensorValue;
int eepromaddress = 0;
 
//Función para simular lectura de un sensor o pin
float ReadSensor()
{
  return 10.0f;
}
 
void setup()
{
}
 
void loop()
{
  sensorValue = ReadSensor(); //Lectura simulada del valor
  EEPROM.put( eepromaddress, sensorValue );  //Escritura del valor en la EEPROM
  eepromaddress += sizeof(float);  //Apuntar a la siguiente posición a escribir
  if(eepromaddress >= EEPROM.length()) eepromaddress = 0;  //Comprueba que no existe desbordamiento 
 
  delay(30000); //Espera 30s
}

Misali don karanta bayanai daga EEPROM

//Leer una variable de coma flotante
#include <EEPROM.h>
 
struct MyStruct{
  float field1;
  byte field2;
  char name[10];
};
 
void setup(){
  
  float f;
  int eepromaddress = 0; //La lectura comienza desde la dirección 0 de la EEPROM    
  EEPROM.get( eepromaddress, f );
  Serial.print( "Dato leído: " );
  Serial.println( f, 3 );  
 
  eepromaddress += sizeof(float);
}
 
void loop()
{
}

Misali don sabunta dabi'u, sake tsarawa

//Actualizar valor de la EEPROM escribiendo el dato entrante por la A0
#include <EEPROM.h>
 
int eepromaddress = 0;
 
void setup()
{
}
 
void loop()
{
   int val = analogRead(0) / 4;
   EEPROM.update(eepromaddress, val);
  
  eepromaddress += sizeof(int);
  if(address == EEPROM.length()) eepromaddress = 0;
 
  delay(10000);  //Espera de 10 segundos
}

Informationarin bayani - Kyautar Arduino kyauta


Abubuwan da ke cikin labarin suna bin ka'idodinmu na ka'idojin edita. Don yin rahoton kuskure danna a nan.

Kasance na farko don yin sharhi

Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Mai alhakin bayanan: Miguel Ángel Gatón
  2. Dalilin bayanan: Gudanar da SPAM, gudanar da sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.