EmbeddedRelated.com
Forums

SofTec PKHCS12C32

Started by luismoreira_2004 April 18, 2005

Hi All
I just recently started with HCS12 and this weekend I decided to use
it on a little project. I need to generate a 250uS pulse every 250mS.
So I modified the example program RTI that came with the Kit, I
changed the RTI prescale and modify the rest of the program to
toggle
PORTB bit 0. the program worked great... Then as I was going to add
more functionality to the program I decided to create a new Project.
I created the project using the wizard in CodeWarrior and set the
target to SoftTec, then I copied the contents of the main.c from the
modified RTI program and pasted it into main.c of my new project.
The problem is that my new project will not debug, there are no
errors
but when I tell it to debug it starts and then stops with
message "unknown event", is almost like it is stepping.
I tried the same with the ADC program and that one works no problem,
so I can only think it is something to do with using the RTI when on
BDM mode...
Can someone guide me on the right direction.
thanks
Luis




Hi Luis,

please make sure that you have correctly declared the interrupt
routines either in the main.c and in the default .prm file of your
project. If I was you I'd disable all the interrupts and try to run
your code, just to see if it works.

Regards,

Nicola
www.softecmicro.com
--- In 68HC12@68HC..., "luismoreira_2004"
<luis.moreira@j...> wrote:
>
> Hi All
> I just recently started with HCS12 and this weekend I decided to
use
> it on a little project. I need to generate a 250uS pulse every
250mS.
> So I modified the example program RTI that came with the Kit, I
> changed the RTI prescale and modify the rest of the program to
> toggle
> PORTB bit 0. the program worked great... Then as I was going to
add
> more functionality to the program I decided to create a new
Project.
> I created the project using the wizard in CodeWarrior and set the
> target to SoftTec, then I copied the contents of the main.c from
the
> modified RTI program and pasted it into main.c of my new project.
> The problem is that my new project will not debug, there are no
> errors
> but when I tell it to debug it starts and then stops with
> message "unknown event", is almost like it is stepping.
> I tried the same with the ADC program and that one works no
problem,
> so I can only think it is something to do with using the RTI when
on
> BDM mode...
> Can someone guide me on the right direction.
> thanks
> Luis




Hi Nicola
Thank you very much, that did the job. When I compared the
SofTec_linker.prm files on both projects the one I created was
missing "Vector 7 RTI_ISR" which defines the interrupt vector for
the RTI. Is this the place that you normal define it ?
best regards
Luis

--- In 68HC12@68HC..., "Nicola Ciot" <nciot@s...> wrote:
>
> Hi Luis,
>
> please make sure that you have correctly declared the interrupt
> routines either in the main.c and in the default .prm file of your
> project. If I was you I'd disable all the interrupts and try to
run
> your code, just to see if it works.
>
> Regards,
>
> Nicola
> www.softecmicro.com >
> --- In 68HC12@68HC..., "luismoreira_2004"
> <luis.moreira@j...> wrote:
> >
> > Hi All
> > I just recently started with HCS12 and this weekend I decided to
> use
> > it on a little project. I need to generate a 250uS pulse every
> 250mS.
> > So I modified the example program RTI that came with the Kit, I
> > changed the RTI prescale and modify the rest of the program to
> > toggle
> > PORTB bit 0. the program worked great... Then as I was going to
> add
> > more functionality to the program I decided to create a new
> Project.
> > I created the project using the wizard in CodeWarrior and set
the
> > target to SoftTec, then I copied the contents of the main.c from
> the
> > modified RTI program and pasted it into main.c of my new project.
> > The problem is that my new project will not debug, there are no
> > errors
> > but when I tell it to debug it starts and then stops with
> > message "unknown event", is almost like it is stepping.
> > I tried the same with the ADC program and that one works no
> problem,
> > so I can only think it is something to do with using the RTI
when
> on
> > BDM mode...
> > Can someone guide me on the right direction.
> > thanks
> > Luis




Yes Luis,

usually the .prm file in CodeWarrior is used to define memory
sections (ROM, RAM, etc.) and interrupt vectors. You will find more
information about that in the Metrowerks CW12 help files (search
the "How To Initialize the Vector Table" paragraph).

Regards,

Nicola
www.softecmicro.com

--- In 68HC12@68HC..., "luismoreira_2004"
<luis.moreira@j...> wrote:
>
> Hi Nicola
> Thank you very much, that did the job. When I compared the
> SofTec_linker.prm files on both projects the one I created was
> missing "Vector 7 RTI_ISR" which defines the interrupt vector for
> the RTI. Is this the place that you normal define it ?
> best regards
> Luis
>
> --- In 68HC12@68HC..., "Nicola Ciot" <nciot@s...> wrote:
> >
> > Hi Luis,
> >
> > please make sure that you have correctly declared the interrupt
> > routines either in the main.c and in the default .prm file of
your
> > project. If I was you I'd disable all the interrupts and try to
> run
> > your code, just to see if it works.
> >
> > Regards,
> >
> > Nicola
> > www.softecmicro.com
> >
> >
> >
> > --- In 68HC12@68HC..., "luismoreira_2004"
> > <luis.moreira@j...> wrote:
> > >
> > > Hi All
> > > I just recently started with HCS12 and this weekend I decided
to
> > use
> > > it on a little project. I need to generate a 250uS pulse every
> > 250mS.
> > > So I modified the example program RTI that came with the Kit,
I
> > > changed the RTI prescale and modify the rest of the program to
> > > toggle
> > > PORTB bit 0. the program worked great... Then as I was going
to
> > add
> > > more functionality to the program I decided to create a new
> > Project.
> > > I created the project using the wizard in CodeWarrior and set
> the
> > > target to SoftTec, then I copied the contents of the main.c
from
> > the
> > > modified RTI program and pasted it into main.c of my new
project.
> > > The problem is that my new project will not debug, there are no
> > > errors
> > > but when I tell it to debug it starts and then stops with
> > > message "unknown event", is almost like it is stepping.
> > > I tried the same with the ADC program and that one works no
> > problem,
> > > so I can only think it is something to do with using the RTI
> when
> > on
> > > BDM mode...
> > > Can someone guide me on the right direction.
> > > thanks
> > > Luis





luismoreira_2004 <luis.moreira@luis...> wrote:
Hi Nicola
Thank you very much, that did the job. When I compared the
SofTec_linker.prm files on both projects the one I created was
missing "Vector 7 RTI_ISR" which defines the interrupt vector for
the RTI. Is this the place that you normal define it ?
best regards
Luis

--- In 68HC12@68HC..., "Nicola Ciot" <nciot@s...> wrote:
>
> Hi Luis,
>
> please make sure that you have correctly declared the interrupt
> routines either in the main.c and in the default .prm file of your
> project. If I was you I'd disable all the interrupts and try to
run
> your code, just to see if it works.
>
> Regards,
>
> Nicola
> www.softecmicro.com >
> --- In 68HC12@68HC..., "luismoreira_2004"
> <luis.moreira@j...> wrote:
> >
> > Hi All
> > I just recently started with HCS12 and this weekend I decided to
> use
> > it on a little project. I need to generate a 250uS pulse every
> 250mS.
> > So I modified the example program RTI that came with the Kit, I
> > changed the RTI prescale and modify the rest of the program to
> > toggle
> > PORTB bit 0. the program worked great... Then as I was going to
> add
> > more functionality to the program I decided to create a new
> Project.
> > I created the project using the wizard in CodeWarrior and set
the
> > target to SoftTec, then I copied the contents of the main.c from
> the
> > modified RTI program and pasted it into main.c of my new project.
> > The problem is that my new project will not debug, there are no
> > errors
> > but when I tell it to debug it starts and then stops with
> > message "unknown event", is almost like it is stepping.
> > I tried the same with the ADC program and that one works no
> problem,
> > so I can only think it is something to do with using the RTI
when
> on
> > BDM mode...
> > Can someone guide me on the right direction.
> > thanks
> > Luis


---------------------------------
Yahoo! Groups Links

To

---------------------------------