Question
I2C EEPROM TO WRITE AD DATA USING STM32F103C8T6 MCU
Hello,
I am try to write the data for memory address in EEPROM using standard protocol I2C. we are trying in data write to memory Address and Driver IC read to operates the Sensorless BLDC motor. so I am working in this method. But am put in the data's for properly in the function but address was can't write properly. I attach my output waveform
.
/* USER CODE BEGIN PV */
uint8_t EE_buff[5]= {0x03,0x50}; // REG_ADD - 0X03 EECTRL , SIdata, eewrite
uint8_t DEV_BUFF[5]= {0x02,0xB6}; // REG_ADD - 0x02 devctrl, enprogkey
uint8_t phres_buff[5]= {0x20,0x39}; // REG_ADD - 0x20 motorparameter 1, phase resistance
uint8_t IS_buff[5]= {0xCF}; // REG_ADD - 0x23 ISDEN, ISDThr, rvsdren, rvsdrthr
uint8_t IPD_buff[5]= {0xF0}; // REG_ADD - 0x2A IPD_EN IPDCURTHR[]
uint8_t OPL2_buff[5]= {0xF8}; // REG_ADD - 0x26 OPENL2CLS_THr
uint8_t Oplcur_buff[5]= {0xC0};
uint8_t ana_buff[5]= {0x02}; // ADD - 0x2B Analog_mode speed pin
/* USER CODE END PV */
/* Private function prototypes -----------------------------------------------*/
void SystemClock_Config(void);
static void MX_GPIO_Init(void);
static void MX_I2C1_Init(void);
/* USER CODE BEGIN PFP */
/* USER CODE END PFP */
/* Private user code ---------------------------------------------------------*/
/* USER CODE BEGIN 0 */
/* USER CODE END 0 */
/**
* @brief The application entry point.
* @retval int
*/
int main(void)
{
/* USER CODE BEGIN 1 */
/* USER CODE END 1 */
/* MCU Configuration--------------------------------------------------------*/
/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_I2C1_Init();
/* USER CODE BEGIN 2 */
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
HAL_I2C_Mem_Write(&hi2c1, 0XA4, 0x02, 2, DEV_BUFF, 2, 10);
HAL_I2C_Mem_Write(&hi2c1, 0XA4, 0x03, 2, EE_buff, 2, 10);
HAL_I2C_Mem_Write(&hi2c1, 0XA4, 0x20, 2, phres_buff, 2, 10);
}
I am programmed this format to write the data. Am I attach need a output data format. I made by mistake please correct me. How can I write the data for I2C EEPROM in the address.
.
