20047 SER2 - Practical I2C: Introduction, Implementation and Troubleshooting

แชร์
ฝัง
  • เผยแพร่เมื่อ 2 ธ.ค. 2024

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

  • @ArjanvanVught
    @ArjanvanVught 5 ปีที่แล้ว +26

    This is the best I2C presentation I've ever seen. Thank you!

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

    03:00 - I2C Overview
    08:00 - Data transfer
    19:54 - Control and Status register
    44:00 - Common issues
    58:15 - Demo
    1:26:00 - Troubleshooting
    1:29:30 - summary

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

    This is the best explanation of i2c I ever saw :):)
    Wish you to do the similar session for spi too

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

    great presentation, this class help me a lot for understanding i2c

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

    Love the way presentation is being presented.

  • @DanielMorenoBio
    @DanielMorenoBio 8 ปีที่แล้ว +3

    Congratzz for this video. biomedical engineering student. Universidad autonoma de baja california

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

    thanks for this course. it would be great if you can include more code examples to write / read and configure registers

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

    This is the best presentation about I2C available on internet. Thank you too!

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

    Thanks for a well presented video.

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

    This is great. I was tired of quick videos that really didn't get to the core. I want to UNDERSTAND THE PROTOCOL not just install random libraries and pray lol.

  • @piclab8340
    @piclab8340 7 ปีที่แล้ว +1

    Very informative video on i2c. Thanks Microchip !

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

    The best course about I2C i ever found. Thank you !

  • @hks9697
    @hks9697 6 ปีที่แล้ว +1

    Wonderfully explained. Thanks a lot.

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

    Excellent! Where can we find the souce code?

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

    Great lecture. Thank you.

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

    Great training. Thank you!

  • @technics6215
    @technics6215 5 ปีที่แล้ว +1

    Thank you! Great I2C training.

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

    Please share demo.c file or zip file to understand function

  • @charlesyeh493
    @charlesyeh493 5 ปีที่แล้ว +1

    very nice presentation~ but is there any way that i can download the power point? thank you

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

    what's the reason behind the second ACK pin?
    And thanks for the video this was one of the best explanation ever found on TH-cam.

    • @MicrochipTechnology
      @MicrochipTechnology  4 ปีที่แล้ว

      @Aayush Dev - Can you please point us to a specific time stamp in the video to help us best answer your question? Thank you!

    • @aayushdev5936
      @aayushdev5936 4 ปีที่แล้ว

      @@MicrochipTechnology 16:26 immediately after the data is sent, it can be seen there is one more ACK .

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

      @@MicrochipTechnology
      That woman telephone operator at bangalore is totally unprofessional & doesn't know how to deal with people. I had called on 08030904444 regarding some queries but she totally behaved in an uncivilized manner. It will be better if there is some professional person instead of her

  • @kmlk1923
    @kmlk1923 4 ปีที่แล้ว

    37:58 "by default it is disabled..." but as it's seen from the slide by default bit value is ZERO and in the definition this enables the feature. Though it is interesting that a CLEAR bit enable a feature ? . So either slide or instructor may be wrong.

    • @MicrochipTechnology
      @MicrochipTechnology  4 ปีที่แล้ว

      Thank you for pointing that out. It is indeed clear (0) by default. This means it is enabled. We checked the datasheet, which is the recommended approach when faced with conflicting ideas. The most recent information is in the datasheet. Thank you for attending this class and paying careful attention to the presentation.

  • @rawlc.5086
    @rawlc.5086 2 ปีที่แล้ว

    This is a nice video but there's one more question to add to your video description... "why every explanation is given in C? Some of us would like to (as long as you are explaining i2c fundaments) know how to use i2c in assembly code", otherwise MCC will solve the code requisitions... and by the way, mnemonics are the closest way to "talk" with PIC's. It would be awesome if you could please explain how to configure it in ASM, with the new xc8 pic-as (wich is completely diferent and hard to addapt previous codes, i'm still trying to understand the new "psect udata udatashare code class=code... etc") it would be so usefull a nice explanation like this. Thanks :)

  • @boopeshrajaneelaraj3442
    @boopeshrajaneelaraj3442 6 ปีที่แล้ว

    "I always read 0xFF. What is wrong?", Please verify the return statement on EEpromread function it returns 0XFF, that is why you always read 0xFF.

  • @MANUELORTIZ-sn2lh
    @MANUELORTIZ-sn2lh 5 ปีที่แล้ว +1

    Thanks for your help.

  • @phtrindadeful
    @phtrindadeful 4 ปีที่แล้ว

    Activation of subtitles, contributions to learning, globally.

  • @sonalikudal9188
    @sonalikudal9188 5 ปีที่แล้ว

    Nice video.. will u plz make one on spi protocol too.. it will be too helpful for students

  • @MANUELORTIZ-sn2lh
    @MANUELORTIZ-sn2lh 5 ปีที่แล้ว

    Excuse me. Can you help me with an addres when I can find courses for study presentially in Microchip. Thanks

  • @mattakalyan1427
    @mattakalyan1427 5 ปีที่แล้ว

    when transmitting the address and next data how the slave is treating it is addressed and it is data after acknowledgment how data is recognized

    • @istvanhorvath5690
      @istvanhorvath5690 4 ปีที่แล้ว

      Address sent by master always a write command. Data could be an uint8_t or uint16_t so 1 or 2 bytes. To store someting after that is a restart and data1 data2 data3.... so on untill stop. You can send 1st a read command without address write. It is the read current address command. Pointer of the slave device is somewhere (maybe the last position of last accomplished i2c process).

  • @sebastianbaiju7757
    @sebastianbaiju7757 5 ปีที่แล้ว +1

    Can I attend this class or can I join with your company

    • @MicrochipTechnology
      @MicrochipTechnology  5 ปีที่แล้ว

      Kindly visit this site for Microchip MASTERs events and to register: techtrain.microchip.com/masters/Home.aspx

  • @hamiltonhorta5441
    @hamiltonhorta5441 7 ปีที่แล้ว +1

    Would it be possible to publish the i2C_demo.c program? I would be very grateful

    • @hemjal100
      @hemjal100 5 ปีที่แล้ว +1

      void eepromWrite (char slaveAddress, char Addhigh, char AddLow, char eeData);
      char eepromread (char slaveAddress, char Addhigh, char AddLow);
      // slave address is the address byte (slave address +r/w bit)
      // addHigh is the eeprom Address high bye
      // eedata is the data to be written in the slave
      volatile char ReadData; // global variable for monitoring.
      void main(void)
      {
      int x; //general purpose variable
      OSCCONbits.IRCF = 12 /// 2MHZ clock
      ANSELB = 0; // All portB pins are digital
      TRISBbits.TRISB0=0; // RB0 is output.
      LATBbits.LATB0 = 1; // LED indicator to know that code is running.
      SSPADD = 4; // 100khZ i2c CLOCK WITH fOSC = 2 mhZ
      // i2c CLOCK = fOSC/ (4*(sspadd+1))
      sspcon1 = 0X28 // sspm = 1000 (i2c mASTER)
      // sspen = 1 (i2c module is enabled)
      eepromWrite (0xA0, 0x12, 0x34, 0x78);
      for (x=1; x

    • @jpdesroc
      @jpdesroc 4 ปีที่แล้ว

      This part of C code is needed and missing at the end of write_I2C(..) function ! or Is-it ??
      I tested the read & write I2C functions using a PCF8563 I2C Real Time Clock
      and noticed some of the RTC registers was uncorrectly written by the write_I2C() function.
      The read_I2C(...) function though was correctly reading any of the RTC registers.
      So I had a look at the write_I2C() function and check the START, ACK, NACK and STOP flags
      and where they were installed in the function..
      And I remembered the Microchip teacher talked about a NACK flag sent from the PIC master
      to the slave EEPROM at the end of the read_I2C() function telling it
      'I don't need any data anymore' so the slave could correctly end up the I2C transmission..
      Since the RTC and the EEPROM can be accessed one register at a time
      or with a sequential datas sent or read from a starting address
      it make sense the NACK should be sent at the end of both write_I2C() and read_I2C() functions right ?
      So the read_I2C() function had a NACK flag sent to the slave at the end of its code,
      but the write_I2C() did not !
      See part of the write_I2C() end below and see the added NACK code.
      After this code added to the write_I2C's end I could now correctly write ANY values
      to the RTC registers and read them back with equal values.
      Maybe I forgot something in my added code here and I'm not doing
      things right but the RTC communication now works perfectly.
      (PIC16F877, Pullup res of 4K7 and I2C speed @ 100Khz)
      Jean-Pierre Desrochers.
      ///////////////////////////////////////////////
      void write_I2C(unsigned char slaveAddress, unsigned char Address, unsigned char Data)
      {
      SSPCON2bits.SEN = 1; // initiate start condition
      while(SEN);
      PIR1bits.SSPIF = 0; // clear SSP interrupt flag
      SSPBUF = slaveAddress; // send slave address and R/W bit
      while(!SSPIF); // wait for ack. SSPIF is set every 9th clock cycle.
      PIR1bits.SSPIF = 0; // clear SSP interrupt flag
      if(SSPCON2bits.ACKSTAT)
      {
      SSPCON2bits.PEN = 1; // initiate stop condition
      while(PEN); // wait for start to complete
      return; // exit write (No ack) cause no slave replied !
      }
      SSPBUF = Address; // send slave address and R/W bit
      while(!SSPIF); // wait for ack. SSPIF is set every 9th clock cycle.
      PIR1bits.SSPIF = 0; // clear SSP interrupt flag
      if(SSPCON2bits.ACKSTAT)
      {
      SSPCON2bits.PEN = 1; // initiate stop condition
      while (PEN); // wait for start to complete
      return; // exit write (No ack) cause no slave replied !
      }
      SSPBUF = Data; // send slave address and R/W bit
      while(!SSPIF); // wait for ack. SSPIF is set every 9th clock cycle.
      PIR1bits.SSPIF = 0; // clear SSP interrupt flag
      if(SSPCON2bits.ACKSTAT)
      {
      SSPCON2bits.PEN = 1; // initiate stop condition
      while(PEN); // wait for start to complete
      return; // exit write (No ack) cause no slave replied !
      }
      ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
      // This part of C code is needed and missing at the end of write_I2C(..) function. //
      else //
      { //
      SSPCON2bits.ACKDT = 1; // Prepare to send NACK

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

    Sir, PIC 16F877A is readable by pickit2, but writing is not working. in one ic, what is the problem? is ic repairable.

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

      In this case, please submit a support case here:
      microchipsupport.force.com/s/communityknowledge

  • @GreatHacker1
    @GreatHacker1 6 หลายเดือนก่อน

    my pic16f687 hasn't many of these registers and there's no example on the datasheet. How can I know what to do to start it on the right way?

    • @MicrochipTechnology
      @MicrochipTechnology  6 หลายเดือนก่อน

      Hi there, thanks for reaching out. To get started, you’ll need to configure your MCU with some basic steps. Setup Configuration Bits: Configure the oscillator, watchdog timer, power-up timer, and low-voltage programming in MPLAB X. Use MPLAB Code Configurator (MCC) for easier setup.
      Some basic example code is here:
      #include
      #define _XTAL_FREQ 20000000
      void main() {
      TRISB = 0x00; // Set PORTB as output
      while(1) {
      LATBbits.LATB0 = 1; // Turn on LED connected to RB0
      __delay_ms(500);
      LATBbits.LATB0 = 0; // Turn off LED
      __delay_ms(500);
      }
      }
      This is to toggle an LED. We hope this helps! If you need more technical guidance, reach out to Microchip.com/CSS.

    • @GreatHacker1
      @GreatHacker1 6 หลายเดือนก่อน

      @@MicrochipTechnology I know how to toogle a led. The pic16f687 doesn't have MCC, the least it has is bits configuration and it's XTAL_FREQ is 8000000. It's like I said, some microcontrollers have a bad documentation

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

    How to write Verilog code for LVDS implementation into M2S025-FG484 FPGA board. Is LVDS incompatible with this board

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

      Hello and thanks for your question! LVDS is supported in the SmartFusion2 M2S025-FG484. Please contact Microchip’s FPGA design partners to learn how to write Verilog code for LVDS implementation: www.microchip.com/en-us/products/fpgas-and-plds/fpga-design-resources/fpga-design-partners.
      We also offer SmartFusion and SmartFusion2 simulation library source files here: microchipsupport.force.com/s/article/SmartFusion-and-SmartFusion2-VHDL-simulation-library-source-files-support-1625098162917
      Please let us know if this helps!

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

    Do you have something like that for CAN protocol in MCC?

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

      Hi Aleksa, this application note might be helpful for you: ww1.microchip.com/downloads/en/Appnotes/MPLAB-Code-Configurator-CAN2.0B-Module-For-PIC18-00002714A.pdff

  • @State_Of_Mind_1947
    @State_Of_Mind_1947 6 ปีที่แล้ว

    Please upload tutorials on USART.

  • @kalyanjanigala
    @kalyanjanigala 4 ปีที่แล้ว

    SPI protocol class plz

  • @pallavilambe1870
    @pallavilambe1870 6 ปีที่แล้ว

    Thanks for video,
    Is the speed of I2C bus is depends on the VDD?

  • @NahuelGDure
    @NahuelGDure 4 ปีที่แล้ว

    I am trying to send a data from the PC using the uart save it in memory and then read from the memory and write again using the uart to display it on the pc. I have used several codes and the problem persists. I send an "a" or "01100001" and receive two bytes "00000000 00111111". Any idea what it could be? I used your code

    • @MicrochipTechnology
      @MicrochipTechnology  4 ปีที่แล้ว

      Kindly visit support.microchip.com for assistance. Thank you.

    • @istvanhorvath5690
      @istvanhorvath5690 4 ปีที่แล้ว

      I tried mcc (code configurator) simple master and eeprom example. Both worked but eeprom example is much better. It is a while (blocked) triggered but accomplised to made self state machine non blocking style.

  • @joshireddy9192
    @joshireddy9192 4 ปีที่แล้ว

    Hi,
    Why is msb bit sent first in the data byte?

    • @MicrochipTechnology
      @MicrochipTechnology  4 ปีที่แล้ว

      Kindly address your question to support.microchip.com. Thank you.

  • @saeednama
    @saeednama 4 ปีที่แล้ว

    Could you please provide the demo code?

    • @MicrochipTechnology
      @MicrochipTechnology  4 ปีที่แล้ว

      Kindly visit support.microchip.com for assistance. We do not provide support on TH-cam. Thank you.

    • @kevin-kw8bv
      @kevin-kw8bv 3 ปีที่แล้ว +1

      @@MicrochipTechnology youtube wont find out, just give him the code bro

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

    MUITO BOM, MAS GOSTARIA DE VER UMA APLICAÇÃO COM ADS1110 (TEXAS) E O PIC 16F873A OU 870

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

      Hi there, thank you for your feedback! We appreciate it and will pass it along to our product team. They will take it into consideration as they strive to enhance our code examples and software libraries.

  • @vigneshvicky8903
    @vigneshvicky8903 5 ปีที่แล้ว

    can a slave control clock line ??

    • @istvanhorvath5690
      @istvanhorvath5690 4 ปีที่แล้ว

      No i2c master is the source of clk signal. This is the syncron wave. Master need to shift out or in the 8bit data.

  • @giaoconhuynh7330
    @giaoconhuynh7330 5 ปีที่แล้ว +1

    Tks for the presentation

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

    Pongan subtitulos !!!!!!

  • @marcos-lq2nh
    @marcos-lq2nh 7 ปีที่แล้ว +2

    NBA Jam T.E.Sega Genesis

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

    Really great presentation, thank you.

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

      Thank you!

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

      @@MicrochipTechnology
      That woman telephone operator at bangalore is totally unprofessional & doesn't know how to deal with people. I had called on 08030904444 regarding some queries but she totally behaved in an uncivilized manner. It will be better if there is some professional person instead of her