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.

Some problems with nRF52832 for iic communication.

Status
Not open for further replies.

GUOJIMIAO

Newbie level 4
Joined
Aug 4, 2021
Messages
6
Helped
0
Reputation
0
Reaction score
1
Trophy points
3
Activity points
52
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!
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top