NCD2100 digital trimming capacitor and I2C communication with an Arduino Uno

Discussion in 'Embedded Systems and Microcontrollers' started by Leo Silver, May 8, 2017.

  1. Leo Silver

    Thread Starter Member

    Apr 27, 2016
    Hi everyone,

    I am trying to program the NCD2100 digital trimming capacitor with an Arduino Uno and I am having difficulties to properly set the software.
    The NCD2100 has a shift register and a non-volatile memory that one can access, upload a specific word (based on the manual an 11 bit word) and achieve the desired capacitance. The thing is that there is no data address for the microcontroller to reach the memory or the shift register in the manual and I am wondering whether I am missing something. Could someone experienced with the I2C protocol please help me a little with this?
    Thank you.
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    This is not I2C, it is just a serial stream with a clock. You can use any two dedicated output pins for this, but you have to write your own bit banging routine. One pin is clock, the other pin is data.

    Make a sub routine to do this where you pass the 11 bit number. Set the clock line low, then test the LSB and set or reset the data pin. Then after a setup delay set the clock high to input the digit. Afteranother delay Shift the number over once and repeat another ten times.

    The delays are the setup and hold times as per the data sheet.
  3. Leo Silver

    Thread Starter Member

    Apr 27, 2016
    Firstly thank you for your answer and secondly for making things a lot clearer! So as I understand I will need to use an output pin of the Arduino and make it behave as a clock depending on when I want to transmit a bit? Could you please explain me a little bit more the : '' Set the clock line low, then test the LSB and set or reset the data pin.''? Why is this important? Is it because the LSB is the CHK bit and I have to see whether I am sending the whole word or bit by bit? I can't thank you enough for your answer I think I was completely in a different path at least now I can start working towards something!

    edit: I realized what you meant with the check the LSB and set or reset the pin but I still don't understand how to tranfer a whole word to the target device.. If anyone can help further I would appreciate it! Although I have a rough idea in my head that I will try to implement.
    Last edited: May 8, 2017
  4. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    Let's say there is a variable, capData, which contains the word to be transferred to the NCD2100.

    I am assuming that you have the clock generation down. If not, ignore it for a second and we'll address it later.

    Check the LSB of capData. Depending on its value, set or reset the output pin. THEN, shift right by one position all the bits in the variable. Repeat this process in a loop for 11 times (the required data length in bits).

    The loop and shift right should achieve the desired result.