AnsweredAssumed Answered

Debugger won't allow breakpoint

Question asked by Matt Meier on Apr 18, 2014
Latest reply on May 8, 2014 by Matt Meier

When I try to set a breakpoint at a certain section of code, the debugger replies with

 

"Breakpoint could not be set at line 26, moved to line 29."

 

This happens only at lines 26 and 27.  Any other locations are just fine, and work properly.

 

I'm using the PE USB Multilink, with an MC9S08DZ60.  I was having this problem this morning, so I updated CodeWarrior, but it still happens.

 

I copied the entire .c file into this post, and typed a red note after each of the two lines that are giving me trouble.  I know some of the code might look a little redundant; I've pared it down quite a bit to try and isolate a problem detecting phase currents, and then I ran into the present issue.  Any help would be much appreciated.

 

Thanks,

 

Matt


#include "derivative.h"
#include "timers.h"

unsigned int pwmCounter;
unsigned int delayCounter;
unsigned int lowCount = 100;
unsigned int offCount = 5000;


interrupt 11 void tpm1OvfIsr(void)
{
if (pwmCounter < offCount)
{
  pwmCounter++;
/*  if ((ADCSC1 && 0x80) != 0)//Check to see if COCO is set
  {
   if (ADCRL >= 13)// 1.28 counts/A
   {
    PTDD &= ~0x08;//Turn off Phase A
   }
   ADCSC1 = 0x20;//Start continuous conversion on Phase A
  }*/
}
if (pwmCounter == lowCount)
{
  PTDD &= ~0x0C;//Turn off D2, D3 (Phases A, B)  THIS IS LINE 26
  ADCSC1 = 0x00;//Turn off ADC          ...AND THIS IS LINE 27
}
if (pwmCounter == offCount)
{
  pwmCounter++;
  PTDD &= ~0x0C;//Turn off D2, D3 (Phases A, B)
  ADCSC1 = 0x00;//Turn off ADC
}
TPM1SC &= ~0x80;//Clear OVF Flag
}

interrupt 14 void tpm2OvfIsr(void)
{
if (delayCounter < 5000)
{
  delayCounter++;
}
TPM2SC &= ~0x80;//Clear OVF Flag
}

void initTimers(void)
{
//Timer 1 - 1kHz
pwmCounter = 0;

TPM1MODH = 0x06;//ModH and ModL set the timer period
TPM1MODL = 0x40;//An 8MHz clock divided by $0640 gives a 5kHz frequency

TPM2MODH = 0x1F;//ModH and ModL set the timer period
TPM2MODL = 0x40;//An 8MHz clock divided by $1F40 gives a 1kHz frequency
 
/* TPM1C0SC = 0x28;//Set MSnB and ELSnB, for edge-aligned, high-true PWM operation
TPM1C0VH = 0x00;//Sets the duty cycle for Channel 0
TPM1C0VL = 0x00;//0%

TPM1C1SC = 0x28;//Same for channel 1
TPM1C1VH = 0x00;
TPM1C1VL = 0x00;*/

TPM1SC = 0x48;//Set TOIE and CLKSA, for interrupts enabled and bus clock source
TPM2SC = 0x48;//Set TOIE and CLKSA, for interrupts enabled and bus clock source
}

Outcomes