SDK nRF5_SDK_15.0.0_a53641a
例程 nRF5_SDK_15.0.0_a53641a\examples\peripheral\twi_sensor
没有修改任何内容,编译烧录到nordic开发板后,
执行到 main函数中 LM75B_set_mode()函数,出现阻塞,没有正常往下执行。阻塞的表达式为 while (m_xfer_done == false);
pics:
是因为SDK的原因吗?
SDK nRF5_SDK_15.0.0_a53641a
例程 nRF5_SDK_15.0.0_a53641a\examples\peripheral\twi_sensor
没有修改任何内容,编译烧录到nordic开发板后,
执行到 main函数中 LM75B_set_mode()函数,出现阻塞,没有正常往下执行。阻塞的表达式为 while (m_xfer_done == false);
pics:
是因为SDK的原因吗?
Please write your question in English.
SDK : nRF5_SDK_15.0.0_a53641a
examples: nRF5_SDK_15.0.0_a53641a\examples\peripheral\twi_sensor
I didn't change anything. After build and download to the Nordic development board,
The LM75B_set_mode() function in the main function is blocked and not executed normally. The blocking expression is while (m_xfer_done == false);
After I used the SDK: nRF5_SDK_15.2.0_9412b96 , also appeared the above situation
Please help to answer it, thank you
lisi said:3. when I write or read , the programmer is always stop in while (m_xfer_done == false);
Are you still not seeing anything on the SCL or SDA lines when your application is running, using your oscilloscope?
If so, could you provide a trace of the communication?
If you are not, the transfer will never complete, which explains why you are stuck in that while loop.
However, if you are able to see the communication as expected, the issue is probably with your TWI slave device.
Best regards,
Karl
Yes, I still not seeing anything on the SCL or SDA lines when my application is running, using my oscilloscope.
Hi again,
Sorry for my late reply.
I will take a look at the code you provided now.
Could you also detail for me how you have connected the nRF52 DK to your sensor, and on which pins you are attaching your oscilloscope?
Which sensor are you using, is it this BMP280 pressure sensor from Bosch?
Best regards,
Karl
Having looked over you code and the BMP280 datasheet(which I have assumed you are using), I have noted the following:
Could you make sure that you have connected your sensor and oscilloscope to the right pins on the nRF52 DK? It seems to me that your initialization is fine, which suggest that the pins might be wrong, since you are not seeing anything on your oscilloscope.
Furthermore, after taking a look in the BMP280 datasheet, your method for writing to the sensor, as used in the function BMP280_set_mode, does not seem to align with the format specified in the datasheet. Please see section 5.2.1 of the datasheet, for its required format.
This is not your current problem - but it will be a future one, once the TWI connection is established.
Best regards,
Karl
Thank you very much for your answer. I have found the reason. It is the hardware, not the program.Thanks again for your earnest answer.
Thank you very much for your answer. I have found the reason. It is the hardware, not the program.Thanks again for your earnest answer.
No problem at all, I am happy to help!
I am glad to hear that we were able to sort out your issue.
Good luck with your continued development! :)
Best regards,
Karl