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.

How to use I2C High Speed Mode on MSP430F2012

Other Parts Discussed in Thread: MSP430F2012

I already have a working implementation of USI I2C (write_reg and read_reg) functions, but I am now being asked to implement High Speed Mode for the project. The MSP430F2012 acts as the master and the buck converter chip that I am working with is the slave. According to the chip's data sheet:

High Speed, 3.4 MHz, Mode
High speed mode is entered by:
1) Start condition
2) Chip Address: 0000 1XXX (X = don't care)
3) Wait a clock for the acknowledge
4) Now everything is in HS mode... do a repeated start (do NOT do a "stop" then a "start" because a "stop" kicks the parts out of HS mode)
5) Send read and or writes in HS mode. (remember to use "repeated starts" between commands.)
6) When you are done with the last command send a "stop" condition to put the part back into regular 400k mode.

Before I get into coding questions, I wanted to clear some things up. My project currently functions correctly with various frequencies (using the line "USICKCTL = USIDIV_6 + USISSEL_2 + USICKPL;" and changing USIDIV_X to get various frequencies) so what does regular 400k mode refer to? Does that just mean that anything up to 400kHz can function without HS mode?

On the same token, does HS mode HAVE to run at 3.4MHz. What does that frequency represent and is it specific to this slave only? Is that frequency guaranteed to work for the MSP430F2012 (as this frequency was only in the slave datasheet and not the MSP430's).

Also, can someone explain to me how HS mode is different in terms of functionality? I'm assuming that there are various hardware changes that allow both master and slave to run at that very high frequency without messing up, but what are they?

Lastly, am I correct in believing that it is the master's job to change the clock to whatever frequency is necessary for HS mode? And once that new clock frequency is set, I just do my reads and writes as usual and assume that some kind of hardware was changed to make it work faster?

Any help would be greatly appreciated.

Thanks,

Matt

 

  • Matt,

    If you take I2C specification http://www.nxp.com/documents/user_manual/UM10204.pdf (former Philips) you will find that there are 5 standard data rates:

    • Standard mode: Sm - up to 100 [kbit/s]
    • Fast mode: Fm - up to 400 [kbit/s]
    • Fast mode plus: Fm+ up to 1 [Mbit/s]
    • High-speed mode: Hs up to 3.4 [Mbit/s]
    • Ultra-fast mode: Uf up to 5 [Mbit/s]

    It is master job to clock the bus properly. Faster mode obviously allow bus to be loaded with more data. I doubt there is some special hardware for different speed modes. Peripheral is either capable of high speed or not.

    Regards,
    Maciej 

  • So I can run high speed mode at less/significantly less than 3.4MHz? Because I can't seem to get my MSP430F2012 to a frequency that high. And let's say I was able to get a frequency as high as 399 kHz. Should I just stay in fast mode, because it the frequency I am at still supports it and there would be no reason to go into high speed mode in that case?

    Matt

  • MaciejKucia said:
    I doubt there is some special hardware for different speed modes.

    Indeed there is. You shall more carefully read document you gave reference to:

    Hs-mode master devices have an open-drain output buffer for the SDAH signal and a
    combination of an open-drain pull-down and current-source pull-up circuit on the
    SCLH output. This current-source circuit shortens the rise time of the SCLH signal.
    Only the current-source of one master is enabled at any one time, and only during
    Hs-mode.

    Obviously msp430f2012 does not contain said circuit for HS mode clock output rise time shortening. So you shall make sure bus is short, low capacitance, pull-ups are properly sized. Maybe series resistors (ringing-dampeners) on master and slave SDA & SCL pins needed to make it work well.

  • Matthew Wasko said:
    Should I just stay in fast mode, because it the frequency I am at still supports it and there would be no reason to go into high speed mode in that case?

    Don't switch into HS mode. I guess that "HS mode" setting for slave means something like "disable clock altering/stretching", that's it. Slave drives data line as fast as possible anyway but clock line is handled by master.

  • Yes, that makes sense. If only I could get my MSP430 to clock faster :( Anyways, thanks for the help!

    Matt

**Attention** This is a public forum