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.

Using MSP430G2553 to create a SPI communication with PGA116 mux

Other Parts Discussed in Thread: MSP430G2553, PGA116

I am trying to use PGA116 multiplexer to select 4 signals and using msp430g2553 to select the channels .

I have trouble understanding which pin from the microcontroller is connected to the multiplexer to select the channels. I gone through the data sheet and connected the SCLK, MISO, MOSI between the two devices.

I also found the code from this link  http://www.argenox.com/library/msp430/ch9-msp430_spi.php

I connected everything as per design ,but i cant get the multiplexer to work....So please find a solution for my problem as soon as possible.

#include <msp430.h>

int main(void)
{
    WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
    
    P1OUT |= BIT5;
    P1DIR |= BIT5;
    P1SEL = BIT1 | BIT2 | BIT4;
    P1SEL2 = BIT1 | BIT2 | BIT4;

    UCA0CTL1 = UCSWRST;
    UCA0CTL0 |= UCCKPH + UCMSB + UCMST + UCSYNC;  // 3-pin, 8-bit SPI master
    UCA0CTL1 |= UCSSEL_2;                     // SMCLK
    UCA0BR0 |= 0x02;                          // /2
    UCA0BR1 = 0;                              //
    UCA0MCTL = 0;                             // No modulation
    UCA0CTL1 &= ~UCSWRST;                     // **Initialize USCI state machine**
}
  • Hello,

    First off, make sure that P1.1 is connected to DOUT, P1.2 to DIN, P1.4 to SCLK, and P1.5 to CS (this specific pin could be changed to any I/O).  Also drive the enable pin high (either through a Vcc rail or with a MSP430 pin) so that it does not enter shutdown mode.  Setting UCCKPH means that you are capturing on the first edge so I assume you are trying SPI 0,0 mode of the PGA116.  

    Setting the output state of P1.5 is going to be important because you have to set the CS low according to page 20 of the PGA116 data sheet.  I'm not too familiar with this device so I'm not exactly sure how it operates, I suggest you read the datasheet to find out more about how to operate it correctly.  If you have a logic analyzer available, it would be a great way to test your SPI lines and make sure that they are operating properly.

    Thanks,

    Ryan

  • Anurag Ravisailekha said:
    So please find a solution for my problem as soon as possible.

    Also, you should read this.

**Attention** This is a public forum