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.

WEBENCH® Tools/MSP430FR2111: MSP430FR2111

Part Number: MSP430FR2111


Tool/software: WEBENCH® Design Tools

I am using a MSP430FR2111 with IAR Workbench 6.5 or 7.4 when it is installed. I find that I cannot alter the pins to toggle up and down. I have cleared the lock. There is no problem with my PCB as I can toggle a led artificially. If I remove all components and the track for the pin, it stoill does not toggle. I have tried a number of pins and also a number of boards. I was concerned about the clock frequency and wanted to observe MCLK and SMCLK but when I select this function I see ground on both pins when I use a CRO. I cannot use an earlier version of Kickstarter as it does not include this MCU. Has anyone experienced anything like this?

TIA

Peter

  • Does the example program that toggles a pin work? If yes, what are you doing differently?
  • PeterG said:
    I have cleared the lock.

    Do you mean the LOCKLPM5 bit in PM5CTL0 register, or something else?

  • Yes, I do mean the LOCKLPM5 bit. In fact that is where I see an issue. Usually with a group of registers it requires a password of 0xA5 and it is read as 0x96. In my case I did not need to set this password as the lock bit was already cleared. Also the password read as 0xA5. Hust in case I wrote 0xA% into the register but it still read out as 0xA5. 

    Thanks

    Peter

  • In SLAC715a I use the first example which toggles the led. However, I have my led on P2.7 so I change the bits accordingly. This does not work for me. In this example the writer clears the LOCKLPM5 bit bit he does not use the password to enable. When I look at the password register it says there is 0x0000 in it. From the user guide it should never be this. I am looking at trying to use CCS for my assembler program to see if it makes any difference. Is there a short tutorial on how to run a program in CCS and debug it?

    Thanks

    Peter
  • Show your code.
  • ;******************************************************************************
    #include <msp430.h>

    ;----------------------------------------------------------------------------------------------------
    ;#define CAP_COUNT R15
    ;#define ? R14
    ;#define COUNTL R13
    ;#define ADDRESSH R10
    #define BUFFER R12
    ;#define COUNTER1 R11
    ;#define ADDRESSL R9
    #define RXTXData R4
    ;#define BitCnt R5
    ;#define TOTAL R8
    ;#define CHECKSUM R11


    ;R5 is a working register
    ;---------------------------------------------------------------------------------------------------
    LOW_BATT SET 01H ;P1.0
    CHARGING SET 02H ;P1.1
    RXD SET 04H ;P1.2
    TXD SET 08H ;P1.3
    PAIR SET 010H ;P1.4
    CTS SET 020h ;P1.5
    RTS SET 040h ;P1.6
    FLASH SET 080h ;P1.7
    ;SPARE SET 01h ;P2.0
    ;SPARE SET 02h ;P2.1
    INHIBIT SET 040h ;P2.6
    LED SET 080h ;P2.7


    ORG 0F100h ;code memory is from 0x0FFFF-0x0F100; ; Program Start
    ;------------------------------------------------------------------------------
    ;

    Reset mov.w #023ffh,SP ; Initialize stackpointer
    mov.w #WDTPW+WDTHOLD,&WDTCTL ; Stop Watchdog Timer
    bic.b #BIT7,&P2OUT
    bis.b #BIT7,&P2DIR
    bic.w #LOCKLPM5,PM5CTL0

    Mainloop
    xor.b #BIT7,&P2OUT
    mov.w #50000,R15
    L1 dec.w R15
    jnz L1
    jmp Mainloop
    nop
  • Why are you using assembler code?

    Anyway, initializing SP with an odd address does not make sense.
    The code itself looks correct, but you have removed the initialization of the reset vector, so the CPU will never jump to your code. (See section 1.2.1 of the User's Guide.)

  • I am using assembler because I want to. I have done this since I started using MSP430 many years ago. My full code is below. I have modified the loading of the SP to make it an even boundary. However, in toggling the led I do not use the stack at all. I do return to the start (Reset) and start up as I observe when running from a FET tool. Of more importance, in my opinion is hwy does the PMM registers all read as 0000 when I reset the device? I have never seen something like this. I can write 0xA500 into PMMCTL0 and it reads back as 0xA500. I even do this with software and move the contacts of PMMCTL0 into R14 and it ends up as 0xA500 in R14. In the user guide it says that PMMCTL0 ALWAYS reads as 0x9800. Does this provide any clues to someone? I am going to try setting this up in CCS6 and see what happens.

    Thanks for the help
  • I found my problem. It was in the set up of the IDE. It was set to simulation mode rather than debugger. Thanks all for the replies

**Attention** This is a public forum