Guest User

Untitled

a guest
Jan 23rd, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. HEX Binary Notes
  2. 0x00000 0000 0000 0000 0000 0000 (Frist Address)
  3. 0x0F400 0000 1111 0100 0000 0000 Swapped A Start
  4. 0x0FFFF 0000 1111 1111 1111 1111 Swapped A End
  5. 0x10000 0001 0000 0000 0000 0000 (Page 2 Start)
  6. 0x18000 0001 1000 0000 0000 0000 Swapped B Start
  7. 0x1F3FF 0001 1111 0011 1111 1111 Swapped B End (Last Address)
  8.  
  9. #include <Wire.h>
  10.  
  11. byte i2c_eeprom_read_byte( int deviceaddress, unsigned long eeaddress ) {
  12. byte rdata = 0xFF;
  13. if( eeaddress > 65535 ){
  14. deviceaddress = deviceaddress | B00000100;
  15. eeaddress = eeaddress & 0xFFFF;
  16. }
  17. Wire.beginTransmission(deviceaddress);
  18. Wire.write((eeaddress >> 8)); // MSB
  19. Wire.write((eeaddress & 0xFF)); // LSB
  20. Wire.endTransmission();
  21. Wire.requestFrom(deviceaddress,1);
  22. if (Wire.available()) rdata = Wire.read();
  23. return rdata;
  24. }
  25.  
  26. void setup() {
  27. Wire.setClock(400000);
  28. Wire.begin(); // initialise the connection
  29. Serial.begin(115200);
  30. delay(100); //add a small delay
  31. Serial.println("Arduino Group Delay Read Program");
  32.  
  33. for (unsigned long i = 0; i < 128000; i++){
  34. Serial.print(i);
  35. Serial.print(",");
  36. byte a = i2c_eeprom_read_byte(0x50, i);
  37. Serial.println(a, BIN);
  38. }
  39. }
  40.  
  41. void loop() {
  42. }
Add Comment
Please, Sign In to add comment