This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/MSP430FR6989: Generating 100kHz signal

Part Number: MSP430FR6989

Tool/software: Code Composer Studio

Hello,

I wanted to implement SCCB protocol (www4.cs.umanitoba.ca/.../ov-sccb.pdf), and in order to do this I need to generate in one GPIO 9 pulses of a 100 kHz signal (SIO_C, which is equivalent to SCL in I2C) and in another GPIO a signal syncronized with the previous one to send data (SIO_D, which is equivalent to SDA in I2C).

As far as I am concerned it is not recomendable to do this using timer interrupts. How do you recommend to do this?

PS. I2C and SCCB are not compatible, so configuring some pins in I2C mode and try to communicate is not a viable option.

  • Hi Juan,

    There are probably many ways to implement the protocol you are referencing. If you do not want to use timer interrupts, then you can just write a function that inputs the data you want to send and then the function itself takes care of sending out the correct clock pulses on one GPIO line and then sends the data on another GPIO line right after.

    The pseudo code would look something like this:

    void sendSCCBData( uint16_t data)
    {
    
    for ( int i = 0 ; i < 9 ; i++ )
    {
    //set the clock GPIO signal
    //__delay_cycles( "duration equal to half of the period you want" )
    //clear the clock GPIO signal
    //__delay_cycles( "duration equal to half of the period you want" )
    }
    
    //send the inputted data bit by bit over the data GPIO line
    
    }

    Best regards,

    Matt

  • I'm not familiar with SCCB, but it appears to be something between I2C (minus the ACKs) and SPI (with tri-states).

    Unfortunately, the MSP430 doesn't offer true open-drain port pins, so the tri-stating can only be done with the I2C or software (DIR) control. (As far as I know it can't do 3-wire SPI , i.e. shared MISO/MOSI, either.)

    I'm not quite clear on the "two-wire tri-state not supported" mode. If the master can't tri-state, then I think that makes it (9-bit) SPI, but the description still refers to tri-stating. Do you know how this mode works?

**Attention** This is a public forum