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.

EZ430-Rf2500 Can we use the SDA and SCL lines for I2C of MSp430f2274

Other Parts Discussed in Thread: CC2500, MSP430F2274, DAC7311, SIMPLICITI

Hi I want to use the SDA n SCL line of Port 3 that is P3.1 and P3.2 which are given as test pins 18 n 15 respectively

But those particular port pins and P3.0 ,P3.1,P3.2 ,P3.3 are used for SPI mode to connect with CC2500

Is there a possibility for using P3.1 and P3.2 for my application for interfacing EEPROm using I2C protocol

  • It is possible. On the eZ430-RF2500 development board the I2C clock line (P3.2) is also connected to the CC2500 chip. It turns out you have to add P3DIR |= 0x0F before P3SEL |= 0x06 in order to disable the CC2500. Once this is done the I2C clock line works correctly. This is all assuming you are not going to need the CC2500.

  • Thank you Brandon.

  • What if I want to use CC2500 as well?

    I am trying to connect a DAC as well as a Digital POT to masp430f2274, they both use I2C. Would it be better to use 3-wire DAC and POT?

    Also, on page 64 of slas614 footnote (7), does it mean to say that B0 is USCI1 and A0 is USCI0? If CLK of one is used then the other is forced to be 3-wire?

     

  • One more question. What is the value of R1 on EZ430? In the schematic it shows it to be 0 and says to remove for external supply is used.

  • I assume you are asking about the eZ430-RF2500T target board and not the USB emulator board.  The eZ430-RF2500 consists of two boards, the one with the USB Type A connector which is the emulator board and the target board which connects to the USB board by a 6-pin connector.  Again, I'm assuming you are referencing the target board discussed on page 18 of the eZ430-RF2500 Development Tool User's Guide (SLAU227).

    Moiz said:

    One more question. What is the value of R1 on EZ430? In the schematic it shows it to be 0 and says to remove for external supply is used.

    When you say "value", I assume you mean "why is it there?".  If so, R1 on the target board allows for the possibility of not getting power from the USB emulator board and supply it from an external supply.  However, in my mind, it is a convenient, series element, that would allow for one to perform current measurements of the target board solutation MSP430F2274+CC2500.

     

  • Hi MoiZ,

                   Even I'm working on the same MSP430F2274 but I m hving problem with I2C communication interfacing Rx8025 Real time clock chip and EEPROM ,

     Did u get a successfull communication with I2C for the Slave device if so please reply me with the code

     

    Thank you,

    Srihk

  • Hey Brandon

    Yes, I wanted to know about R1 on the target board. But, I wanted to know its resistance. I looked for it in the users guide but couldnt find it. On the schematic it shows a 0 on it but for others it shows thier resistance. On the board itself I see a chip resister solder on for R1. So, i wanted to know what its resistance.

    Thanks

    Fahad

  • I havent done any interfacing yet. I just want to know if I can use USCIB0 for both I2C and 4-Wire SPI simultaneously.

    I want CC2500 that uses 4-wire SPI, and also connect a DAC and a POT that uses I2C.

    I was wondering, since pins 9 and 10 are used for both modes, how will it work when both modes are needed simultaneously.

    If not then can I have more than 1 slave in SPI mode? Cause I can get DAC and POT that use 3-wire SPI too.

    Also, on page 64 of slas614 footnote (7), does it mean to say that B0 is USCI1 and A0 is USCI0? If CLK of one is used then the other is forced to be 3-wire?

    Any help will be appreciated.

    Thanks

    Fahad

  • Moiz said:

    I havent done any interfacing yet. I just want to know if I can use USCIB0 for both I2C and 4-Wire SPI simultaneously.

    No, only one of the modes can be supported at one time.

     

    Moiz said:

    I want CC2500 that uses 4-wire SPI, and also connect a DAC and a POT that uses I2C.

    Using the eZ430-RF2500 kit, you will need to  use 2 other pins for I2C and implement a bit-band I2C master.

     

    Moiz said:

    I was wondering, since pins 9 and 10 are used for both modes, how will it work when both modes are needed simultaneously.

    The peripheral inside the MSP430 will not support simultatneously two different modes.

     

    Moiz said:

    If not then can I have more than 1 slave in SPI mode? Cause I can get DAC and POT that use 3-wire SPI too.

    If you use a DAC with a SPI interface, then yes you could use the one SPI peripheral plus 2 GPIOs to act as selects for the external devices.  The 3-wire SPI would have CLK, MISO, MOSI.  However, you would need to use 2 GPIOs and add some code to select which SPI slave device to talk to.

     

  • Moiz said:

    Yes, I wanted to know about R1 on the target board. But, I wanted to know its resistance. I looked for it in the users guide but couldnt find it. On the schematic it shows a 0 on it but for others it shows thier resistance. On the board itself I see a chip resister solder on for R1. So, i wanted to know what its resistance.

    Zero is the value.  There are 0 ohm resistors and I suspect R1 is one of them.

  • hi,

         I wanna try the software method for I2C generation that is bit banging

         I have seen one example in the Slav038


         I have 2 questions
    1: P3DIR is making the port input or output direction but how can we

    make it high or low  ( 0 or 1) are u using the logic of Pull up that
    it is connecting to Vcc hence value 1 and Vss value zero
    (my doubt is P3OUT should be used I feel to send high or low values)
    and P3DIR must also be used as input while receiving Rx: and output while Tx:

    2.U are using SDA_Low as making line low but how is it possible
    according to the declaration it is P3DIR =0x01; which mean P3.1 is set
    to output direction and which is value 1 on the P3.1

    please help me regarding this , it might be basic question but Im
    unable to judge between P3DIR and P3OUT which one is correct

     

    #define SDA_Low  P3DIR  |=  SDA;                // Making SDA Line Low
    #define SCL_Low  P3DIR  |=  SCL;                // Making SCL Line Low
    #define SDA_High P3DIR  &= ~SDA;                // Making SDA Line High
    #define SCL_High P3DIR  &= ~SCL;                // Making SCL Line High

  • Moiz: If not then can I have more than 1 slave in SPI mode? Cause I can get DAC and POT that use 3-wire SPI too.

    BrandonAzbell: If you use a DAC with a SPI interface, then yes you could use the one SPI peripheral plus 2 GPIOs to act as selects for the  external devices.  The 3-wire SPI would have CLK, MISO, MOSI.  However, you would need to use 2 GPIOs and add some code to select which SPI slave device to talk to.

    Hey BrandonAzbell

    I am using TI's DAC7311(DAC) and Analog Devices AD5165 (Digital POT). They both are 3-wire SPI.

    DAC has SYNC, DIN and SCLK and the POT has CS, SDI and CLK.

    This is how I think the connection between MSP430F2274(Master), and CC2500, DAC7311, AD5165 (3 Salves) should be:

    MSP430F2274 ---------> CC2500, DAC7311, AD5165

    UCB0STE ----------> CSn, SYNC, CS

    UCB0MOSI ---------> SI, DIN, SDI

    UCB0CLK ---------> SCLK, SCLK, CLK

    UCB0MISO ---------> SO (No connection for DAC or POT here)

    Does this look correct???

    If so please can explain to me how the microcontroller will send data to the various slaves? I ask this because in CC2500 I see that there us address BITs (A0 - A5) which I understand tells the mictrocontroller to send data to this address. But in the DAC and the POT there are no address BITs. The data is written to them as soon as the chip select goes low. So how will the microcontroller know, when to send to a particular slave?

    You say to use 2 GPIOs. Can you explain a little a bit more how that should be implemented.

    Thanks a million.

     Fahad

  • All the connects look correct with the exception of the following:

    UCB0STE ----------> CSn, SYNC, CS

    You can not have all three slave devices connected to the same CS signal from the MSP430F2274.  You should have each of the slave devices, CC2500, DAC7311 and AD5165 have a unique GPIO to act as its CS.
    This would then require your software to first assert the GPIO (ie. CS) before using the USCI B module to send data.  After the transaction, the GPIO (ie. CS) would be deasserted by your software.

     

    Just as a side note:

    I have made one small correction to the signals on the MSP430F2274.

    UCB0SIMO ---------> SI, DIN, SDI

    UCB0CLK ---------> SCLK, SCLK, CLK

    UCB0SOMI ---------> SO (No connection for DAC or POT here)

  • Makes sense now. Thanks a lot.

  • Yes, and an ohm-meter agrees.

  • Hi Brandon,

    I'm new to the MSP430 family and have what I hope is a quick question or two.

    First, as a baseline, I'm using the following:

    -          Compiler: IAR Kickstart v4.20.01 (latest version,  we think)

    -          Firmware: eZ430-RF2500 Wireless Sensor Monitor IAR Source v1.02 (also the latest, we think)

    -          Demo Hardware: several eZ430-RF2500 Development tools

    -          In our product, we are planning on using the MSP430F2274 + CC2500 + two I2C peripherals

     

    Question:

    -          Currently in the eZ430 development tool hardware/firmware, the msp430 talks to the CC2500 via the USCI, UC’B’ port. 

            I need to switch the CC2500 over to the UC’A’ port to free up the UCB port for the I2C hardware. 

            I've started pouring through the simpliciTI firmware and the code that defines the UCB vs UBA ports for the CC2500 elludes me.

     

    -          We need to change the configuration of the UCB port from SPI to I2C to support the two attached peripherals.

            That also has been difficult to get my hands wrapped around.

     

    Your thoughts would be greatly appreciated.

     

    Best Regards,

    -TonyC

     

     

  • If you turn off the chip select line for the CC2500 then it won't be listening, and perhaps you can do I2C to the other peripheral... I don't know the pinouts of SPI vs I2C on the MSP430, but you could look them up in the data sheet. I would be surprised if the pins were very different.

  • Thanks Sage for your input,

    However, referring to the MSP4302274 device, there are two channels supported on the USCI interface; chA and chB.  It so happens (probably quite arbitrarily) the eZ430-RF2500 demo board uses chB (UCBxxx) to communicate with the CC2500.  I need to switch the MSP430 communication to the CC2500 part in firmware (I've already made the necessary hardware changes) from chB to chA.

    This is necessary because chB supports I2C and SPI while chA only supports SPI.  My design needs to support two I2C peripherals.

    So my questions are:

    -what changes do I need to make in firmware to change comm to the 2500 part from chB to chA.  Likely one or more defines somewhere, but I'll be darn if I can find them. 

    -second, how to configure chB from SPI to I2C.    

  • first deselect the pins used for SPI using P3SEL &=~( BITx + BITy);

    x & y means the particular pins and then P3DIR =0xFF;  then P3SEL  |=(BITx+BITy);

     

    and if ur code works successfully in establishing the I2C communication between the Master and Slave then please post  the code

    Thanks in advance

**Attention** This is a public forum