ardunio ile fram okumak

Başlatan armsistem, 14 Mayıs 2015, 08:33:40

armsistem

Arkadaşlar merhaba , bir fram okumaya çalışıyorum;
- 8x512 = 4kbit ; 8 bit 512 adet yani 4096 denk geliyor doğrumudur ? okuyup yazağım değer char olacak ?
-xxxxxxxx  - 8 bit
-xxxxxxxx
-...........
512 adet

Aşağıdaki kodlar çalışıyor lakin bir yerde hata yapıyorum çalışan master fram okuyorum boşa yazıyorum , sonra okuyorum ikisi de aynı gibi duruyor fakat yazma yaptığım çalışmıyor...
#include <Wire.h>
#include <FRAMX.h>
#include <stdint.h>
#include <EEPROM.h>

//Initialize the FRAM and use the default FRAM address that's provided
FRAMX fram(FRAMX::FRAMX_I2C_DEFAULT_ADDRESS);


void setup(){
  Wire.begin(); //we must call this before using any I2C functions!
  Serial.begin(9600);
  Serial.print("Talking to FRAM at address \n");
  Serial.print(FRAMX::FRAMX_I2C_DEFAULT_ADDRESS, HEX);
  Serial.print("\n");
  
}

void loop(){
  unsigned char read_buffer[]={};
  unsigned int start_address ;
  unsigned int bytes_to_transfer; // do not exceed the length of your read and write buffer

  unsigned char write_buffer[]={0x11,0x47,0xFE,0xAF,0xC7,0x6F,0x50,0xDB,0x0,0x0,0x80,0x3F,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0xF0,0xFD,0x27,0x13,0x1F,0xF7,0x6,0x2D,0x3,0xF,0x5A,0x7E,0x0,0x0,0x0,0x0,0x6A,0xB2,0x9F,0xE7,0x2,0x0,0x0,0x0,0x78,0x1,0x0,0x0,0x0,0x0,0x1F,0x43,0x0,0x0,0x0,0x0,0x33,0x33,0x53,0x40,0x66,0x66,0x7E,0x41,0x0,0x0,0x0,0x0,0x0,0x0,0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x0,0x0,0x40,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x40,0x0,0xA0,0x2,0x45,0x7D,0x3F,0x55,0x3F,0x58,0x39,0xD4,0x3F,0xA0,0x1A,0x17,0x40,0x0,0x0,0x48,0x43,0x0,0x0,0xFA,0x43,0x0,0x80,0x40,0x44,0x7D,0x3F,0x55,0x3F,0x58,0x39,0xD4,0x3F,0xA0,0x1A,0x17,0x40,0x0,0x0,0x48,0x43,0x0,0x0,0xFA,0x43,0x0,0x80,0x40,0x44,0x0,0x0,0x20,0x42,0x0,0x0,0x8C,0x42,0x0,0x0,0xC8,0x42,0x0,0x0,0x8C,0x42,0x0,0x0,0x80,0x3F,0x0,0x0,0x80,0x3F,0x0,0x0,0x80,0x3F,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0};
                         




                    







    bytes_to_transfer = 1;       
for(start_address=0;start_address<512;start_address=start_address+1){
fram.write(start_address, &write_buffer[start_address], bytes_to_transfer);  
    Serial.print("set FRAM[");
     Serial.print(start_address, DEC);
     Serial.print("]=");
       Serial.println(write_buffer[start_address], HEX);
      
       }    

      

bytes_to_transfer = 1;

Serial.println("EEpromdan okuma yapiliyor....\n");
for(start_address=0;start_address<512;start_address=start_address+0x01){
      fram.read(start_address , &read_buffer[0], bytes_to_transfer); 
    Serial.print("0x");                    //yazılıyor
   Serial.print(*read_buffer,HEX);    //değer okunuyor
   Serial.print(",");  
    }                       //bekleme yapılıyor
  //*************************************************************************************************//
}

Icarus

Ne yapmak için fram kullanıyorsunuz ?

armsistem

bir cihazda kullanılan fram kopyalamak için uğraş veriyorum

mehmet

Lojik analizör işe yaramaz mı?
Olan olmuştur,
olacak olan da olmuştur.
Olacak bir şey yoktur.
---------------------------------------------
http://www.mehmetbilgi.net.tr
https://creativecommons.org/licenses/by/4.0/deed.tr "CC BY"