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.

Simulate MSP430 using IAR Embedded Workbench

Other Parts Discussed in Thread: MSP430F427

Hi,

I'm new to TI MSP430 microcontrollers. I installed IAR Embedded Workbench and I wrote a simple assembly code to simulate the TimerA_3 on MSP430F427 to generate a PWM signal on a I/O pin. I studied the device datasheet but I can't find the reason because the Timer doesn't count. Here is the code:

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

#include "msp430.h"                     ; #define controlled include file
  
        NAME    main                    ; module name

        PUBLIC  main                    ; make the main label vissible
                                        ; outside this module
        ORG     0FFFEh
        DC16    init                    ; set reset vector to 'init' label

        RSEG    CSTACK                  ; pre-declaration of segment
        RSEG    CODE                    ; place program in 'CODE' segment

init:   MOV     #SFE(CSTACK), SP        ; set up stack

main:   NOP                             ; main program
        MOV.W   #WDTPW+WDTHOLD,&WDTCTL  ; Stop watchdog timer
  
        MOV.W   #255,TACCR0             ; Count up to 255
        MOV.W   #128,TACCR1             ;set initial Duty Cycle (50%)
        MOV.W   #OUTMOD2+OUTMOD1+OUTMOD0,TACCTL1  ; Reset/Set mode for OUT1
       
        BIS.B   #00000100b,P1DIR        ;P1.2 =OUTPUT
        BIS.B   #00000100b,P1SEL        ;P1.2 = TimerA OUT1
       
        MOV.W   #TASSEL1+MC0,TACTL      ;start TimerA in UP mode and select SMCLK like clock source
                                            
        JMP $                           ; jump to current location '$'
                                              ; (endless loop)
        END

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

In the register view, in TimerA_3 window, i can't see the TAR counting but remains fixed to 0x0000.

Excuse me for the English (i'm Italian)

  • Hi Domian,

    By default, new IAR projects are configured to use the simulator, not the FET debugger.  Your code is probably executing on the PC, which is simulating the MSP430.  However, the simulator does not properly simulate the peripherals (like timers).

    You can change the project configuration to use the FET debugger from the Project menu.  Post back if you can't find it.  Once you make the change, the IAR menu called "Simulator" will be replaced by the IAR menu "Emulator".

    Jeff

  • yes my code was executing on the PC and i wanted to simulate the MSP430. After I searched related posts in this forum, I understood that this is not possible in IAR to simulate the peripherals. However, after all, I connected the FET programmer to the PC and I verified the correctness of the code on the board with the oscilloscope. Now I ask you, is there a tool or a software capable of simulating the peripherals? I come from other microcontroller platforms in which I could do this and is powerful. Thank you.
  • The MSPGCC project got a new sibling recently: teh MSPDebug project has reached V0.15 and is now simulating some of the peripherals. It is, however, still in the early experimental stage. You can download MSPdebug from http://mspdebug.sourceforge.net/download.html
  • IAR doesn't provide any peripheral simulation (yet).  And I don't know of any other simulation options.  (I did not know about MSPdebug, either.)

    Jeff

  • I think you ought to forget about simulation of MSP430. This is not solution with existing software.

    It seems very strange in spite  of existance of such tools for AVR, MCS51 and some other architectures.

  • ok, thanks to all

**Attention** This is a public forum