• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!
Neetee

External eeprom library

5 posts in this topic

Hello all 

I am almost done with my project due to all  your help

Posting probably the last query 

I am trying to download library for external eeprom connected using i2c to my msp430f5529 launch pad.

The entire library is available on github 

As github recently updated the website i cannot download the new libraries. Can anyone help me out by providing some other sources for this library.

Library i am searching is 

External eeprom using i2c for msp430f5529 launch pad 

Thanks and regards 

Share this post


Link to post
Share on other sites

Hallo I am using this code for my 430G2553.

/*
LaunchPad EEPROM
 Author		: Henk Siewert
 File		: EEPROMTest
 Date		: 27 september 2016
 Version	: 003
 MCU		: TI MSP430G2553
 Memory		: Microchip
 Language	: Energia C++
 Compiler	: Energia 0101E0017
 Systeem	: Windows XP Pro SP3
 Editor		: NotePad++
 WWW		: http://www.swtcomp.com
 
 Pin 6 IC = SCL --> 9	LET OP! Nieuw in 17
 Pin 5 IC = SDA --> 10	LET OP! Nieuw in 17
 Pin 8 IC = VCC --> Vcc (3.3V)
 Pin 4 en 7 IC = GND --> GND
 4,7K Pull up on pin 5 and 6 !!! Let op - Is jumper geplaatst?
*/

#include <Wire.h>		// I2C library

int disk1 = 0x50;		// Address of EEPROM chip
//                        50 for Microchip 1,2,3 GND
//                        57 for Atmel 1,2,3 open

#define memmax 32768	// Maximum memory:
//                          32768 for Microchip 24LC256
//                          65536 for Microchip 24LC512
//                         131072 for Microchip 24LC1026
//                           4096 for Atmel 24C32
byte value = 133;       // Value to write to EEPROM

void setup(void)
{
  Serial.begin(9600);  	// Start serial
  Wire.begin();        	// Start I2C
  start();				// Start program
}

void start()
{
  test();
}

void test()   // Write and read data to memory locations
{
  for ( unsigned long address = 0; address < memmax; address++)
  {
    writeEEPROM(disk1, address, value);
    Serial.print( address );
    Serial.print(" = ");
    Serial.print(readEEPROM(disk1, address));
    Serial.println("  ");
  }
}

void writeEEPROM(int deviceaddress, unsigned long eeaddress, byte data ) 
{
  Wire.beginTransmission(deviceaddress);
  Wire.write((int)(eeaddress >> 8));   	// MSB
  Wire.write((int)(eeaddress & 0xFF)); 	// LSB
  Wire.write(data);
  Wire.endTransmission();
  delay(5);   							// Writing takes time
}

byte readEEPROM(int deviceaddress, unsigned long eeaddress ) 
{
  byte rdata;

  Wire.beginTransmission(deviceaddress);
  Wire.write((int)(eeaddress >> 8));   // MSB
  Wire.write((int)(eeaddress & 0xFF)); // LSB
  Wire.endTransmission();
  Wire.requestFrom(deviceaddress,1);
  if (Wire.available()) rdata = Wire.read();

  return rdata;
}

void loop()
{
  // Not used
}

 

Fmilburn and bluehash like this

Share this post


Link to post
Share on other sites

Hallo Neetee,

The routines/functions are very generic.

Maybe the I2C pins are different.
But that is no problem.

Just try it.
That's the fun of experimenting.That;s why I love this as a hobby.
If it is for money, pleas try it and you can pay me royalties. :)

Come on, go for it.

Greetings from a very sunny Netherlands.

Fmilburn likes this

Share this post


Link to post
Share on other sites

Cool with it 

I will try for this and if required will make changes in it and i will post on this forum for others to use 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now