nRF5 SDK - Tutorial for Beginners Pt 35 A - TWI - I2C - Introduction with Basics

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ก.ย. 2024
  • This tutorial is also a part of my on going series for beginners and in this tutorial we will learn how to program I2C or TWI in nrf5 sdk using nrf52832 or nrf52840. We will learn the basics of I2C communication. Twi is fully compatible with I2C communication protocol, so its similar and it can easily be used to communicate with devices supporting I2C communication. We will learn the basics of I2C or TWI and in the end we will learn how to program it and how to communicate with a sensor or I2C compatible devices.
    The main code is available for download from here:
    drive.google.c...
    Be sure to check it out ;-)
    If you like my work & want me to keep on making more tutorials on these devices, please do support me. You can make a one time donation or buy me a coffee :p on my PayPal Account:
    PAYPAL: www.paypal.com...
    just click on this link to proceed, thanks :)
    You can also support me through my Patron:
    PATRON: / sumairsembeddedenginee...
    just click this link to proceed. Your donations will keep me motivated, as I spend hours & hours to make a good quality content free of cost for everybody. Thanks in Advance... ;p
    If you want to support me and want to learn the full course including all the code and tutorials then you can buy the full course on my official website, after this course you will be able to transfer data between BLE devices as well as create your own custom services and send custom types of data, so what are you waiting for, hurry up and buy our course, first 50 customers will get it at a discounted price:
    👉🏼 courses.sumair...

ความคิดเห็น • 30

  • @Manan720
    @Manan720 4 ปีที่แล้ว +4

    Thanks for putting out a video on TWI.

  • @restonjesus
    @restonjesus 3 ปีที่แล้ว +1

    Thanks for your video. It's very useful. Nordric should pay for your lecture. you are better than any other from nordic.

  • @ash8356
    @ash8356 2 ปีที่แล้ว

    Thank you for this wonderful vedio was able to read the address from I2c which means tge communication has established . Got some initial start for the project . Thank you .

  • @TheAviationAnonymous
    @TheAviationAnonymous 3 ปีที่แล้ว +1

    Super helpful videos. Thank you so much for your in depth series on the NRF5 SDK. I am used to Arduino, but I want to learn more advanced embedded programming, so this series is perfect.

  • @rezapapi6544
    @rezapapi6544 3 ปีที่แล้ว

    I am trying to use ble with twi and u mentioned that the priority is must be set carefully. what should I do for that? because when I am using twi the ble stops advertising.

  • @mineofinvention5068
    @mineofinvention5068 9 หลายเดือนก่อน

    My program stuck at nrf twi rx () function
    I am running i2c scanner example please help

  • @kaushalkumar3169
    @kaushalkumar3169 3 ปีที่แล้ว

    hii ! thank you for making it easy to understand the nrf mcu. I am running your code and given the correct 7 bit base address but it is not showing the I2C device connected. can you please provide me some info to scan the I2C device

  • @cryptonian5533
    @cryptonian5533 2 ปีที่แล้ว

    Hello Sir.
    I have designed a Bluetooth service. Currently I am working on combining the Bluetooth service with the TWI_Scanner program. Could you help me in it?

    • @SumairsEmbeddedEngineering
      @SumairsEmbeddedEngineering  2 ปีที่แล้ว

      You can send me an email on my official account: samsembeddedengineering@gmail.com, and brief me further details.

  • @RashidAli-jh1ok
    @RashidAli-jh1ok 2 ปีที่แล้ว

    Sir what should be the priority if we are using soft devices?

    • @SumairsEmbeddedEngineering
      @SumairsEmbeddedEngineering  2 ปีที่แล้ว

      i have mentioned the priorities in the BLE section of tutorials, you can just use priority 6,7 for the twi communication.

  • @arjun.k7090
    @arjun.k7090 4 ปีที่แล้ว

    What are the pins you are connecting your MPU6050 with the nrf board
    vcc-->vdd
    gnd-->gnd
    scl-->?
    sda-->?

    • @Ed.R
      @Ed.R 3 ปีที่แล้ว

      void twi_init(void)
      {
      ret_code_t err_code; // a variable to hold error code
      const nrf_drv_twi_config_t twi_config = {
      .scl = 22, // scl connected to pin 22, you can change it to any other pin
      .sda = 23, // sda connected to pin 23, you can change it to any other pin

  • @cryptonian5533
    @cryptonian5533 2 ปีที่แล้ว

    Does every MPU-6050 has same address? I am trying for last few days but my MPU isn't working. I changed the MPU as well, but nothing happened 😢

    • @SumairsEmbeddedEngineering
      @SumairsEmbeddedEngineering  2 ปีที่แล้ว +1

      yes it depends on the address pins, for example if you connect AD0 pin of mpu6050 to logic high(3.3V) then its base address will change from 0x68 to 0x69. You can test on which address it responds by checking this tutorial.th-cam.com/video/-YjCpy1AFog/w-d-xo.html , hope it helps. ;p

    • @cryptonian5533
      @cryptonian5533 2 ปีที่แล้ว

      @@SumairsEmbeddedEngineering Sir thank you very much for reply. I am following that tutorial and I addr// read some data from the sensor
      err_code = nrf_drv_twi_rx(&m_twi, address, &sample_data, sizeof(sample_data));
      if(err_code == NRF_SUCCESS) // if reading data was successful
      {
      NRF_LOG_INFO("Successfully detected a device at address: 0x%x", address); // let the users know its working

      }
      else{
      NRF_LOG_INFO("No Any Device Detected...");
      }
      After a few seconds, the ELSE message is executed. Same happens If I turn off MPU, or remove SCL pin. What maybe the reason sir?

    • @SumairsEmbeddedEngineering
      @SumairsEmbeddedEngineering  2 ปีที่แล้ว +2

      @@cryptonian5533 if you dont see anything on putty terminal, simply check the nrf sdk config.h file using cmsis config wizard, if you dont know how to work with cmsis config, watch my tutorial on this. Change the option in logging, uncheck log deffered, and you will see the output.

  • @seyedsajjadmirbakht5573
    @seyedsajjadmirbakht5573 4 ปีที่แล้ว +1

    I do appreciate your time for providing these useful videos.
    I hope you start the Bluetooth wireless communication in the near future as well.

    • @RashidAli-jh1ok
      @RashidAli-jh1ok 2 ปีที่แล้ว

      Hello. Are you able to do it?
      I have designed a Bluetooth service. Currently I am working on combining the Bluetooth service with the TWI_Scanner program. Could you help me in it?

  • @jansijanu4483
    @jansijanu4483 ปีที่แล้ว

    Superb Very useful video. I have to read some potentiometer data using I2c with nrf52840 for ADC(MCP3426/7/8). Can you please give me some sample code or give me some ideas

  • @cryptonian5533
    @cryptonian5533 2 ปีที่แล้ว

    Thank you very much sir for giving us the precious knowledge.

  • @someaftab1660
    @someaftab1660 3 ปีที่แล้ว

    I like you man!

  • @RashidAli-jh1ok
    @RashidAli-jh1ok 2 ปีที่แล้ว

    If we don't have the LOGGER, instead of displaying on the LOGGER, can we just blink the LEDs on board to check whether or not our MPU is working

    • @SumairsEmbeddedEngineering
      @SumairsEmbeddedEngineering  2 ปีที่แล้ว +1

      yeah you can also use leds to show the states. Check my BSP led tutorial to show different states using leds.

  • @francisstoffberg
    @francisstoffberg 3 ปีที่แล้ว

    This video is a lifesaver man!!! Thanks so much!