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.

Simple peripheral select question

Other Parts Discussed in Thread: MSP430G2553

On the MSP430G's you use the PSEL and PSEL2 registers to select which peripherals you want to use. For example: with the msp430g2553 pin 14 (P1.6) has the following functionality.  P1.6/TA0.1/UCB0SOMI/UCB0SCL/A6/CA6/TDI/TCLK.  Now, with the two PSEL registers you get to set four values.  00, 01, 10, 11.  I'm a bit confused because it looks like there are more than 4 peripherals.  I'm trying to use UCB0SOMI and from looking at this it looks like the first peripheral would be TA0.1 and the second would be UCB0SOMI so I would think you would set the PSEL registers as follows:  P1SEL1 &=~ BIT6, P1SEL2 |= BIT6 giving you a value of 10 or two.  I feel like I'm missing something though because a lot of the examples I've seen for using SPI on UCB0 set bot PSEL1 and PSEL2 to 1 yielding 11.

Whats the deal?  How do I know exactly what to set the PSEL registers to so I can get the correct peripheral?

Thanks

  • Robbie Valentine said:
    P1.6/TA0.1/UCB0SOMI/UCB0SCL/A6/CA6/TDI/TCLK.  Now, with the two PSEL registers you get to set four values.  00, 01, 10, 11.  I'm a bit confused because it looks like there are more than 4 peripherals.

    Indeed, there are. However, the solution is not obvious but simple:

    The TEST pin can switch this pin to JTAG use (TDI/TCLK) which overrides any otehr funcitonality. UCB0SOMI and UCB0SCL are two signals generated by the USCIB0 module. Only one of the m is generated, depending on USCIB0 onfiguration (SPI or I2C mode).
    And A6 and CA6 are analog circuits directly attached to the pin and independent of the digital circuitry.

    If you want to know more, look at the MSP430G2553 datasheet, port schematics. It explains (with a few msitakes here and there) not only the truth table for PxSEL and otehr relevant bits, but also the logic effects of them. This is the final authority (except for trying) about what's going on. Different MSPs have different port pin logic. On some the PxDIR bit disables the pullup resistors, on some the pullups coexist with an active output etc.

  • Thanks a lot for the answer.  I see what you are talking about now...down about 40 pages in the device specific datasheet there is a bunch of port information.  This was a large overlook on my part, but thanks again!  Huge help!

**Attention** This is a public forum