GUOJIMIAO
Newbie level 4
Hi, amazing people!
I have encountered some problems with nRF52832 for iic communication. I also read about the datasheet and more details of nrf523832 from this article:https://www.utmel.com/components/nr...uetooth-datasheet-pinout-and-schematic?id=215. Therefore, I would like to ask for advice. When writing data to mcp4725 with nrf52832, I have scanned the device address to be 0x62, but the data written to this address is always not written in. I don’t know what went wrong. my code to write data is given below:
static void write_sensor_data(uint16_t m_sample)
{
uint8_t output_1,output_2;
uint16_t m_sample_1,m_sample_2;
m_sample_1=m_sample>> 4;
m_sample_2=m_sample%16;
output_1 = m_sample_1&0x00ff;
output_2 = m_sample_2<<4;
ret_code_t err_code;err_code = nrf_drv_twi_tx(&m_twi, MCP4725_ADDR, &output_1, sizeof(output_1),false);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_twi_tx(&m_twi, MCP4725_ADDR, &output_2, sizeof(output_2),false);
APP_ERROR_CHECK(err_code);
Thanks for the help advanced!
I have encountered some problems with nRF52832 for iic communication. I also read about the datasheet and more details of nrf523832 from this article:https://www.utmel.com/components/nr...uetooth-datasheet-pinout-and-schematic?id=215. Therefore, I would like to ask for advice. When writing data to mcp4725 with nrf52832, I have scanned the device address to be 0x62, but the data written to this address is always not written in. I don’t know what went wrong. my code to write data is given below:
static void write_sensor_data(uint16_t m_sample)
{
uint8_t output_1,output_2;
uint16_t m_sample_1,m_sample_2;
m_sample_1=m_sample>> 4;
m_sample_2=m_sample%16;
output_1 = m_sample_1&0x00ff;
output_2 = m_sample_2<<4;
ret_code_t err_code;err_code = nrf_drv_twi_tx(&m_twi, MCP4725_ADDR, &output_1, sizeof(output_1),false);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_twi_tx(&m_twi, MCP4725_ADDR, &output_2, sizeof(output_2),false);
APP_ERROR_CHECK(err_code);
Thanks for the help advanced!