Adafruit I2C FRAM MB85RC256VPF and SAMD21 Xplained pro board
In this quick tutorial you will see how to connect I2C FRAM breakout from adafruit with SAMD21 Xplained pro board .
connection :
SAM >>> FRAM
PA08 >>> SDA
PA09 >>> SCL
VCC"3.3V >>VCC
GND >>>GND
the code based on adafruit FRAM library and it's very easy to use , I re-write it without a library using atmel start and ASF4 , with I2C Master synchronous mode.
code functions :
void FRAM_Begin(uint8_t address)
will enable the I2C bus and set the FRAM address in default it's 0x50
void getDeviceID(uint16_t *manufacturerID, uint16_t *productID)
to check the Manufacture ID and Product ID
void FRAM_write (uint16_t framAddr, uint8_t value);
write a value to a specific address where:
framAddr : address (0-32767)
value : value to write (0-255)
uint8_t FRAM_read (uint16_t framAddr);
return a value from a specific address where:
framAddr : address (0-32767)
Basic code : I2C standard Mode
in This code I used I2C scl = 100KHz "standard mode"
open the terminal window and set the baud rate to 115200 and will see the value on the window.
Basic code : I2C fast Mode +
in this example I used CLK=500KHz
Post a Comment