Difference between revisions of "Category:Memory"

From ElectroDragon
Jump to: navigation, search
(PSRAM)
(PSRAM)
 
(17 intermediate revisions by the same user not shown)
Line 126: Line 126:
 
File:Spi_flash.jpeg | SPI Flash schematic
 
File:Spi_flash.jpeg | SPI Flash schematic
 
</gallery>
 
</gallery>
== PSRAM ==
+
== RAM ==
 +
* SRAM - Static
 +
* [[:File:VTI7064LSMxx.pdf|VDI SRAM datasheet]]
 +
=== RAM, PSRAM ===
 
* Serial Pseudo-SRAM
 
* Serial Pseudo-SRAM
 +
[[File:Ly68L6400.png|thumbnail|800px]]
 +
[[File:Pico-psram wiring.jpg|400px|thumbnail]]
 +
* [https://drive.google.com/file/d/1-5NtY1bz0l9eYN9U0U4dP3uASwnMmYGP/view?usp=sharing Datasheet of IPUS IOT RAM]
 +
* Datasheet of Lyontek PSRAM
 +
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
Line 138: Line 146:
 
| LY68S3200 - 32Mbit || SOP 8 || 1.8V
 
| LY68S3200 - 32Mbit || SOP 8 || 1.8V
 
|-
 
|-
| LY68L6400 - 64Mbit || SOP 8 || 3.3V
+
| [[:File:LY68L6400_0.3.pdf|LY68L6400]] - 64Mbit || SOP 8 || 3.3V
 +
|-
 +
| LY68L3200 - 32Mbit || SOP 8 || 3.3V
 +
|}
 +
* Pin Definition with ESP32-PICO Board
 +
{| class="wikitable sortable"
 +
|-
 +
! PICO Kit Pins !! PSRAM SOP8 Pins !! Note
 +
|-
 +
| IO9  || 1 #cs clk || pulled up to VDD 3.3V !
 +
|-
 +
| IO17 ||  2  || FSD0
 +
|-
 +
| IO7  || 3 || FSD3
 +
|-
 +
| GND  || 4 || Ground
 +
|-
 +
| IO8  || 5 || FSD1
 +
|-
 +
| IO10  || 6 ||
 +
|-
 +
| IO11  || 7 || FSD2
 +
|-
 +
| VDD3.3  || 8 || VDD
 +
|-
 +
| IO6 || - || FCLK
 +
|-
 +
| IO16 || - || FCS
 +
 
 
|}
 
|}
*
+
* 32 Mbit 1.8 Wrover
 +
* 32 Mbit 3.3 Wroom, Pico, RDA
 +
* 64 Mbit 3.3 RDA
 +
 
 +
* Code reference - https://esp32.com/viewtopic.php?f=2&t=2713&start=30#p13463
 +
 
 +
== SD Card Holder ==
 +
<gallery>
 +
File:Sd_card_header.png
 +
</gallery>
  
 
== The rest ==
 
== The rest ==

Latest revision as of 11:54, 21 March 2018

Instruction

There are three pools of memory in the microcontroller used on avr-based Arduino boards :

  • Flash memory (program space), is where the Arduino sketch is stored.
  • SRAM (static random access memory) is where the sketch creates and manipulates variables when it runs.
  • EEPROM is memory space that programmers can use to store long-term information.

Flash memory and EEPROM memory are non-volatile (the information persists after the power is turned off). SRAM is volatile and will be lost when the power is cycled.

The ATmega328 chip found on the Uno has the following amounts of memory:

  • Flash 32k bytes (of which .5k is used for the bootloader)
  • SRAM 2k bytes
  • EEPROM 1k byte

The ATmega2560 in the Mega2560 has larger memory space :

  • Flash 256k bytes (of which 8k is used for the bootloader)
  • SRAM 8k bytes
  • EEPROM 4k byte

SPI FLASH VS EEPROM:

Flashmemorylayout.png
  • EEPROM have smaller capacity (typically in Kbit size) will Flash have a larger capacity (typically in Mbit size)
  • SPI bus is more commonly seen in Flash device due to high serial speed (in MHz range, e.g. 40/60MHz)
  • Flash has divided memory into three levels of granularity, namely: pages, blocks, sectors(This apply to Atmel DataFlash/Adesto DataFlash)
  • EEPROM data memory is seen as a block of continuous memory, each data with respective address. Each data byte is access by its respective memory address.

SPI Flash

  • SST - SST25VF016B-50-4C-S2AF
  • Winbond - W25Q64FVSSIG
25Q128FVSG.png
  • Simple wiring
D13, D12, D11, D10 of arduino to SPI flash - CLK, DO, DI and CS, 
3V3 arduino to 3v3, wp, hold, and GND of arduino to GND
  • Data need to be erased before write again.
  • flash winbond W25Q SPI Flash

W25Q SPI Flash.jpeg

Update on-board SPI-Flash

Here is an example of our MT7688AN board, flash uboot or firmware

  • No need to connect anymore, use programmer power supply
  • Connect pin VDD, MOSI, CLK, MISO, CS, GND
  • Detect on board SPI Flash size 16Mb, which is W25Q128FVSSIG
  • Upload you file, uboot or firmware

EEPROM

Common used EEPROM ICs

  • AT24C32 ~ 256

Arduino EEPROM Demo Code and Wiring

#include <Wire.h>
#define EEPROM_END 0x50
String text = "electrodragon.com";
int start = 0;
int count = 0;
void setup(){
 Wire.begin();
 Serial.begin(9600);
 Serial.println("Writing in EEPROM...");
 for (int x=start; x<text.length(); x++){
 i2c_eeprom_write(EEPROM_END, x, byte(text.charAt(x)));
 delay(5);
 }
 Serial.println("written completed!!!");
 Serial.println("");
}
void loop(){
 for (int x=start; x<text.length(); x++){
 Serial.print(i2c_eeprom_read(EEPROM_END, x));
 }
 Serial.print(" count number: ");
 Serial.println(count);
 count+=1;
 delay(1000);
}
 
void i2c_eeprom_write(int end_eeprom, unsigned int end_memoria, byte valor)
{
 Wire.beginTransmission(end_eeprom);
 Wire.write((int)(end_memoria >> 8));
 Wire.write((int)(end_memoria & 0xFF));
 Wire.write(valor);
 Wire.endTransmission();
}
 
char i2c_eeprom_read(int end_eeprom, unsigned int end_memoria)
{
 Wire.beginTransmission(end_eeprom);
 Wire.write((int)(end_memoria >> 8));
 Wire.write((int)(end_memoria & 0xFF));
 Wire.endTransmission();
 Wire.requestFrom(end_eeprom, 1);
 byte dado;
 if (Wire.available()){
 dado=Wire.read();
 }
 Wire.endTransmission();
 return dado;
}

SD Card Read

  • Wiring
5V - VCC, GND - GND
D13 - SD_CLK, D12 - SD_OUT, D11 - SD_IN, D10 - SD_CS
  • Arduino library, and upload SD card example sketch.

Demo code

For Stm32:

Schematic

RAM

RAM, PSRAM

  • Serial Pseudo-SRAM
Ly68L6400.png
Pico-psram wiring.jpg
Type Package Specs
MT45W8MW16BGX Example Example
LY68S6400 - 64Mbit SOP 8 1.8V
LY68S3200 - 32Mbit SOP 8 1.8V
LY68L6400 - 64Mbit SOP 8 3.3V
LY68L3200 - 32Mbit SOP 8 3.3V
  • Pin Definition with ESP32-PICO Board
PICO Kit Pins PSRAM SOP8 Pins Note
IO9 1 #cs clk pulled up to VDD 3.3V !
IO17 2 FSD0
IO7 3 FSD3
GND 4 Ground
IO8 5 FSD1
IO10 6
IO11 7 FSD2
VDD3.3 8 VDD
IO6 - FCLK
IO16 - FCS
  • 32 Mbit 1.8 Wrover
  • 32 Mbit 3.3 Wroom, Pico, RDA
  • 64 Mbit 3.3 RDA

SD Card Holder

The rest

RAM - lost data when power off

  • SRAM - static ram, high speed ram between CPU and main ram, first cache, expensive and big
  • DRAM - dynamic ram, sram speed > dram, second cache
  • SDRAM - sync DRAM
  • DDR - Double Data Rate SDRAM

Documents

This category currently contains no pages or media.