EmbeddedRelated.com
Forums

Help on Codewarrior ( HCS12 ) PC simulation

Started by mdn4u August 4, 2003
Hi all,

I am working towards designing motor control system using motorola
HCS12 MCU. Just bought Codewarrior Standard edition as development
environment and expecting DP256 evolution board in 2-3 weeks.

To reduce the development time I am planning to use Codewarrior PC
simulation to understand and simulate few of HC12 peripheral
components like SCI, CRG(clock and reset generation), ADC and PWM.

I could simulate SCI quite easily. I could program the registers for
specific baud rate and view the data in visual tool 'terminal'. And
to some extem I could simulate CRG behaviour and could generate RTIs. My question is, can I simulate ADC, PWM similarly using visual tools
like Bar, Chart etc. ? If simulation is possible, can someone provide
one example. ( I have tried Processor Expert to generate the programs
fast but no help )

Any help in this regard is highly appreciated.

Warm Regards
MDN



Well, if you can do it so that it means something, I would sure like to
hear about it. I think every simulator has some screwball method for
simulating I/O that will run data in and out. The problem is that you
can't simulate what you don't understand. I am referring to noisy
interrupts, and random characters (in the case of the SCI) and pulses that
are too short/long to measure (PWM) and the other detritus of everyday living.

On the other hand, I'm not familiar with Bar and Chart. How would they help?

Gary Olmstead
Toucan Technology
Ventura CA At 06:20 AM 8/4/03 +0000, you wrote:
>Hi all,
>
>I am working towards designing motor control system using motorola
>HCS12 MCU. Just bought Codewarrior Standard edition as development
>environment and expecting DP256 evolution board in 2-3 weeks.
>
>To reduce the development time I am planning to use Codewarrior PC
>simulation to understand and simulate few of HC12 peripheral
>components like SCI, CRG(clock and reset generation), ADC and PWM.
>
>I could simulate SCI quite easily. I could program the registers for
>specific baud rate and view the data in visual tool 'terminal'. And
>to some extem I could simulate CRG behaviour and could generate RTIs. >My question is, can I simulate ADC, PWM similarly using visual tools
>like Bar, Chart etc. ? If simulation is possible, can someone provide
>one example. ( I have tried Processor Expert to generate the programs
>fast but no help )
>
>Any help in this regard is highly appreciated.
>
>Warm Regards
>MDN >
>-------------------- >
>">http://docs.yahoo.com/info/terms/
>




I'm not familiar with the bar or chart either. I'm guessing that they are
"components" in the True-Time Simulator and Real Time Debugger, but I've
never been able to figure out how to use them. I recall using a graphing
feature, so one could see the analog representation of a changing variable
using (what is now TI's) Code Composer. It was pretty cool and I always
thought it to be a useful tool. So I have tried to use the advertised
"components" in CodeWorrier, with totally no results, as usual. Actually,
the Hi-Ware tools are usually pretty good, if you ever figure out how to use
them. I'd appreciate some tips. Please don't tell me to read the
"Manuals." They're indecipherable. That's what I used to get from the
official CW help people, before my warranty ran out.

Bob White

----- Original Message -----
From: "Gary Olmstead" <>
To: <>
Sent: Monday, August 04, 2003 8:15 AM
Subject: Re: [68HC12] Help on Codewarrior ( HCS12 ) PC simulation > Well, if you can do it so that it means something, I would sure like to
> hear about it. I think every simulator has some screwball method for
> simulating I/O that will run data in and out. The problem is that you
> can't simulate what you don't understand. I am referring to noisy
> interrupts, and random characters (in the case of the SCI) and pulses that
> are too short/long to measure (PWM) and the other detritus of everyday
living.
>
> On the other hand, I'm not familiar with Bar and Chart. How would they
help?
>
> Gary Olmstead
> Toucan Technology
> Ventura CA > At 06:20 AM 8/4/03 +0000, you wrote:
> >Hi all,
> >
> >I am working towards designing motor control system using motorola
> >HCS12 MCU. Just bought Codewarrior Standard edition as development
> >environment and expecting DP256 evolution board in 2-3 weeks.
> >
> >To reduce the development time I am planning to use Codewarrior PC
> >simulation to understand and simulate few of HC12 peripheral
> >components like SCI, CRG(clock and reset generation), ADC and PWM.
> >
> >I could simulate SCI quite easily. I could program the registers for
> >specific baud rate and view the data in visual tool 'terminal'. And
> >to some extem I could simulate CRG behaviour and could generate RTIs.
> >
> >
> >My question is, can I simulate ADC, PWM similarly using visual tools
> >like Bar, Chart etc. ? If simulation is possible, can someone provide
> >one example. ( I have tried Processor Expert to generate the programs
> >fast but no help )
> >
> >Any help in this regard is highly appreciated.
> >
> >Warm Regards
> >MDN
> >
> >
> >
> >--------------------
> >
> >
> >
> >">http://docs.yahoo.com/info/terms/
> >
> -------------------- >
> ">http://docs.yahoo.com/info/terms/ >



Thanks for the response,

Since I have 2-3 weeks to get by EVM thought why not try simulating
some of the MCU peripherals of my interest. Documents available on
web with regard to this are very few and they are not at all
exhaustive and more of confusing. One document says 'bar' ( acts as a
potentiometer ) can be used as ADC analog input and use any other
componets like 'static text' to read the digital value from data
register. Easier way to create this setup is using processor expert
beans. But it's not explained how to configure 'bar' as input ADC
channel instead one example in the document configures 'bar'
as 'memory' by associating it to ADC data register itself, which is
not at all practical. Moreover processor expert generated program
does not work unless you do some modifications because it looks like
processor expert generates program for actual target not for
simulation. This True-Time Simulator is total mess and not of much
use. As Gary told you can't simulate what you don't understand. I am
just planning to stop spending time on this and speeding the procees
of getting EVM. It seems like using processor expert I can reduce the
develpoment time to some extent.

Can some one suggest me the way to test a set of peripherals ( SCI,
CRG, ADC and PWM ) using one simple test program. If someone can pass
on the program it would be of great help.

Thanks in advance.

Warm Regards
MDN

--- In , "Bob White" <bob@w...> wrote:
> I'm not familiar with the bar or chart either. I'm guessing that
they are
> "components" in the True-Time Simulator and Real Time Debugger, but
I've
> never been able to figure out how to use them. I recall using a
graphing
> feature, so one could see the analog representation of a changing
variable
> using (what is now TI's) Code Composer. It was pretty cool and I
always
> thought it to be a useful tool. So I have tried to use the
advertised
> "components" in CodeWorrier, with totally no results, as usual.
Actually,
> the Hi-Ware tools are usually pretty good, if you ever figure out
how to use
> them. I'd appreciate some tips. Please don't tell me to read the
> "Manuals." They're indecipherable. That's what I used to get from
the
> official CW help people, before my warranty ran out.
>
> Bob White
>
> ----- Original Message -----
> From: "Gary Olmstead" <garyolmstead@e...>
> To: <>
> Sent: Monday, August 04, 2003 8:15 AM
> Subject: Re: [68HC12] Help on Codewarrior ( HCS12 ) PC simulation > > Well, if you can do it so that it means something, I would sure
like to
> > hear about it. I think every simulator has some screwball method
for
> > simulating I/O that will run data in and out. The problem is
that you
> > can't simulate what you don't understand. I am referring to noisy
> > interrupts, and random characters (in the case of the SCI) and
pulses that
> > are too short/long to measure (PWM) and the other detritus of
everyday
> living.
> >
> > On the other hand, I'm not familiar with Bar and Chart. How
would they
> help?
> >
> > Gary Olmstead
> > Toucan Technology
> > Ventura CA
> >
> >
> > At 06:20 AM 8/4/03 +0000, you wrote:
> > >Hi all,
> > >
> > >I am working towards designing motor control system using
motorola
> > >HCS12 MCU. Just bought Codewarrior Standard edition as
development
> > >environment and expecting DP256 evolution board in 2-3 weeks.
> > >
> > >To reduce the development time I am planning to use Codewarrior
PC
> > >simulation to understand and simulate few of HC12 peripheral
> > >components like SCI, CRG(clock and reset generation), ADC and
PWM.
> > >
> > >I could simulate SCI quite easily. I could program the registers
for
> > >specific baud rate and view the data in visual tool 'terminal'.
And
> > >to some extem I could simulate CRG behaviour and could generate
RTIs.
> > >
> > >
> > >My question is, can I simulate ADC, PWM similarly using visual
tools
> > >like Bar, Chart etc. ? If simulation is possible, can someone
provide
> > >one example. ( I have tried Processor Expert to generate the
programs
> > >fast but no help )
> > >
> > >Any help in this regard is highly appreciated.
> > >
> > >Warm Regards
> > >MDN
> > >
> > >
> > >
> > >--------------------
> > >
> > >
> > >
> > >">http://docs.yahoo.com/info/terms/
> > >
> >
> >
> >
> > --------------------
> >
> >
> >
> > ">http://docs.yahoo.com/info/terms/
> >
> >
> >





MDN,

Maybe it would be appropriate for you to invest in good debugging tools
that allow you to actually test your code on the actual silicon rather than
attempting to simulate it using a simulator.

Using a BDM you can test the peripherals on your target board.
Even better but more expensive is a full-emulator, that offers many
benefits over a BDM including the ability to test your code on the actual
silicon even before you have designed or received your target board. Once
you receive the target board, you can plug it to the full-emulator and
continue to the next step of your debugging.

You can read the following articles to get more details:
http://www.nohau.com/products/hcs12_emulator_features.pdf
http://www.nohau.com/appnotes/hcs12bdm_emulator.pdf

Hope this helps,
Doron
Nohau Corporation
HC12 In-Circuit Emulators
www.nohau.com/emul12pc.html

At 09:26 AM 8/6/2003 +0000, you wrote:
>Thanks for the response,
>
>Since I have 2-3 weeks to get by EVM thought why not try simulating
>some of the MCU peripherals of my interest. Documents available on
>web with regard to this are very few and they are not at all
>exhaustive and more of confusing. One document says 'bar' ( acts as a
>potentiometer ) can be used as ADC analog input and use any other
>componets like 'static text' to read the digital value from data
>register. Easier way to create this setup is using processor expert
>beans. But it's not explained how to configure 'bar' as input ADC
>channel instead one example in the document configures 'bar'
>as 'memory' by associating it to ADC data register itself, which is
>not at all practical. Moreover processor expert generated program
>does not work unless you do some modifications because it looks like
>processor expert generates program for actual target not for
>simulation. This True-Time Simulator is total mess and not of much
>use. As Gary told you can't simulate what you don't understand. I am
>just planning to stop spending time on this and speeding the procees
>of getting EVM. It seems like using processor expert I can reduce the
>develpoment time to some extent.
>
>Can some one suggest me the way to test a set of peripherals ( SCI,
>CRG, ADC and PWM ) using one simple test program. If someone can pass
>on the program it would be of great help.
>
>Thanks in advance.
>
>Warm Regards
>MDN >
>
>--- In , "Bob White" <bob@w...> wrote:
> > I'm not familiar with the bar or chart either. I'm guessing that
>they are
> > "components" in the True-Time Simulator and Real Time Debugger, but
>I've
> > never been able to figure out how to use them. I recall using a
>graphing
> > feature, so one could see the analog representation of a changing
>variable
> > using (what is now TI's) Code Composer. It was pretty cool and I
>always
> > thought it to be a useful tool. So I have tried to use the
>advertised
> > "components" in CodeWorrier, with totally no results, as usual.
>Actually,
> > the Hi-Ware tools are usually pretty good, if you ever figure out
>how to use
> > them. I'd appreciate some tips. Please don't tell me to read the
> > "Manuals." They're indecipherable. That's what I used to get from
>the
> > official CW help people, before my warranty ran out.
> >
> > Bob White
> >
> > ----- Original Message -----
> > From: "Gary Olmstead" <garyolmstead@e...>
> > To: <>
> > Sent: Monday, August 04, 2003 8:15 AM
> > Subject: Re: [68HC12] Help on Codewarrior ( HCS12 ) PC simulation
> >
> >
> > > Well, if you can do it so that it means something, I would sure
>like to
> > > hear about it. I think every simulator has some screwball method
>for
> > > simulating I/O that will run data in and out. The problem is
>that you
> > > can't simulate what you don't understand. I am referring to noisy
> > > interrupts, and random characters (in the case of the SCI) and
>pulses that
> > > are too short/long to measure (PWM) and the other detritus of
>everyday
> > living.
> > >
> > > On the other hand, I'm not familiar with Bar and Chart. How
>would they
> > help?
> > >
> > > Gary Olmstead
> > > Toucan Technology
> > > Ventura CA
> > >
> > >
> > > At 06:20 AM 8/4/03 +0000, you wrote:
> > > >Hi all,
> > > >
> > > >I am working towards designing motor control system using
>motorola
> > > >HCS12 MCU. Just bought Codewarrior Standard edition as
>development
> > > >environment and expecting DP256 evolution board in 2-3 weeks.
> > > >
> > > >To reduce the development time I am planning to use Codewarrior
>PC
> > > >simulation to understand and simulate few of HC12 peripheral
> > > >components like SCI, CRG(clock and reset generation), ADC and
>PWM.
> > > >
> > > >I could simulate SCI quite easily. I could program the registers
>for
> > > >specific baud rate and view the data in visual tool 'terminal'.
>And
> > > >to some extem I could simulate CRG behaviour and could generate
>RTIs.
> > > >
> > > >
> > > >My question is, can I simulate ADC, PWM similarly using visual
>tools
> > > >like Bar, Chart etc. ? If simulation is possible, can someone
>provide
> > > >one example. ( I have tried Processor Expert to generate the
>programs
> > > >fast but no help )
> > > >
> > > >Any help in this regard is highly appreciated.
> > > >
> > > >Warm Regards
> > > >MDN
> > > >