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.

MSP430F6638: PortU pins function as outputs sample code

Part Number: MSP430F6638


Hey,

 

Do anybody have complete sample code or link to sample code showing how to enable PU.0 and PU.1 as Output pins and toggle them High-Low.

I am aware of section 42.2.1.3 Port U Control in the MSP430x6xx Family Users Guide, but it’s not working for me.

My IAR compiler doesn’t even let me work with PUSEL, but send the following message when trying to run it:

Error[Pe137]: expression must be a modifiable lvalue

Any hint or help is highly appreciated.

  • Hi Steffen, 

    Have you looked at section 42.4.1.3?

    So I don't think we have an exact example to refer to but the user guide shows the USB-PHY control register is how you configures these pins. 

    So to enable PU.0 and PU.1 you first need to unlock USBKEYPID (USB key register, found on 42.4.1.1). 

    Here is a screenshot of USB-PHYCTL:

    How you supply power to this port also matters. According to the section you referenced (42.2.1.3), "Port U is supplied by the VUSB rail. If the 3.3-V LDO is not being used in the system (disabled), the VUSB pin can be supplied externally" 

    regards, 

    Henok

  • Hi Henok,

    Thank you for your help, highly appreciated.

    I read that PUOUT0 and PUOUT1 are in the USB-PHY Control Register and this register can only be modified when USBKEYPID is unlocked.
    So I need to unlock / lock USBKEYPID each time I want to physical change status of PUOUT0 and PUOUT1 pins?

  • Hi Steffen, 

    Yes that sounds correct. The USBKEYPID register unlocks all USB control registers.

    regards, 

    Henok

**Attention** This is a public forum