AnsweredAssumed Answered

How can I fix the error??

Question asked by angelo avila on Mar 6, 2015
Latest reply on Mar 9, 2015 by Pascal Irrle

Good day everyone, i have encountered a problem that everytime that the program has been debugged into the P&E multilink cyclone pro 3 dialog box would pop up consecutively. first is about HI-WAVE telling that "communications with the target failed: the target MCU has no clock or wrong BDM clock speed is used or derivative is secured." the second one would be "error while loading diagnostics algorithm to target system. The chip may be secured, or the derivative selected may be wrong" and lastly s "this operation has been canceled." this happened after I added the following to my codes:

 

RAMSTART: EQU $1000

FLASHSTART: EQU $C000

StackPointer: EQU $1F00

 

i took it from http://www.freescale.com/files/CodeWarriorIDEDemo.pdf slide 14 of 28

 

I am trying to program the PWM of a HCS12 32bit microcontroller with NI elvis II instruction set. though i found a program wherein it uses it on a Dragon 12 plus trainer board. the programs is

 

ABSENTRY Entry        ; for absolute assembly: mark this as application entry point

   

; Include derivative-specific definitions

  INCLUDE 'mc9s12dp256.inc'     ;CPU used by Dragon12+ board

 

;code section

        ORG   $4000     ;Flash ROM address for Dragon12+

Entry:

       LDS     #$4000    ;Stack

      

        MOVB #$04, PWMPRCLK ;ClockA=Fbus/2**4=24MHz/16=1.5MHz

       MOVB #125, PWMSCLA ;ClockSA=1.5MHz/2x125=1.5Mhz/250=6000Hz

       MOVB #$10, PWMCLK   ;Use clockSA for chan 4 PWM

       MOVB #$10,PWMPOL ;High then low for polarity

       MOVB #$0,PWMCAE   ;Left aligned

       MOVB #$0, PWMCTL   ;8-bit chan,PWM during feeze and wait

       MOVB #100, PWMPER4 ;PWM_Freq=ClockSA/100=6000Hz/100=60 Hz. CHANGE THIS 

       MOVB #50, PWMDTY4 ;50% duty cycle   AND THIS TO SEE THE EFFECT ON SERVO MOTOR (TRY LESS THAN 10%)

       MOVB #0,PWMCNT4   ;Start the counter with zero (optional)

       BSET PWME,%00010000  ;Enable chan 4 PWM

       BRA $

                   

;**************************************************************

;*                 Interrupt Vectors                          *

;**************************************************************

            ORG   $FFEE

            DC.W  Entry     ;Reset Vector. CPU wakes here and it is sent to start of the code at $4000

 

the program came from a modified example from Mazidi and Causey HCS12 book.

 

i placed the code i took after " INCLUDE 'mc9s12dp256.inc' " part

 

i want to fix things. im at fault due to i was not able to notice that the program i added is for MC9S12DG128B derivative and we are supposed to use a different one(sorry i forgot) but i want to fix it so please i need help.

Outcomes