Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[ARM] EEPROM interfacing with cortex M0

Status
Not open for further replies.

nmem

Newbie level 4
Joined
May 10, 2016
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
53
Hello

I have to program cortex M4 microcontroller with eeprom to receive and send some bytes. I should use bit fields to program it or complete byte registers such as TW_CR?

mem
 

Its an external eeprom 24AA64F. I have to configure TWI_MMR register (microcontroller: AT SAM4E). Is there any clock generator required? As the maximum speed for eeprom is 400KHz and for microcontroller is 120MHz, For down conversion if I load 0C hex, in which register I should place the value?
 

HI,

I´m sure when you read the TWI section of your microcontroller you will find twi clock setup informations.

Klaus
 

24AA64F uses I2C interface and 16 bit memory addressing. I can give you EEPROM driver for I2C, but I2C driver you will have to write yourself.
 

Ok I hope that will help me. :)
 

Code:
I2C_Result I2C__Read_FullPage (unsigned char I2c_Address, 
                               unsigned char * Reg_Address,
                               unsigned char Reg_Address_Len,
                               unsigned char * pBuffer, 
                               unsigned char pBufferSize)
{
  I2C_Result Result = I2C__Start();
  if (Result) return Result;
  Result = I2C_ADD_NOT_EXIST;
  if (I2C__Write(I2c_Address & 0xFE) == ACK)
  {
    Result = (I2C_Result)ACK;
    while(Reg_Address_Len-- && Result == ACK)
      Result = (I2C_Result)I2C__Write(* Reg_Address++);
      I2C__ReStart();
      if (I2C__Write(I2c_Address | 0x01) == ACK)
      {
        while (pBufferSize--)
          *pBuffer++ = I2C__Read(pBufferSize ? 1 : 0);
        Result = I2C_SUCCESS;
      }   
  }
  I2C__Stop();
  return Result;
}
The same way for writing. Hope you will do it yourself. In your case Reg_Address_Len = 2 (u16)
 

[Moved]c code required for atmel SAM microcontroller

Can anypne please share the code of connecting 22AA64F eeprom with atmel SAM4E micocontroller.?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top