EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

A little help

Started by the_oog6789 January 4, 2005

I have just been given a Adapt9S12E128 for a project and I'm having
trouble getting started. It came in a box with CodeWarrior CW12
V3.0 and a cd with software(ubug12, demo apps) and datasheets.
Following the steps provided on the CD I have not been able to load
any of the demo programs onto the chip. I tried writting my own
program using codewarrior and downloading it using ubug12 but still
no luck. Do I have to move the jumpers around a bit or should i be
using some other program other than ubug12 to download.

Here is the simple program i generated using codewarrior's wizard.
I was trying to turn the red LED on the development board on and off.

Any tips on getting started would be great.

Thanks heaps... #include <hidef.h> /* common defines and macros */
#include <mc9s12e128.h> /* derivative information */

#include "main_asm.h" /* interface to the assembly module */

#pragma LINK_INFO DERIVATIVE "SampleS12"

void main(void) {
/* put your own code here */

int counter;

PTP = 0x00; //port P i/o reg
// PTIP //port p input can't write to this
DDRP = 0xFF;//port p data direction reg
RDRP = 0x00; //reduced drive reg
PERP = 0x00; //port p pull device enable reg
PPSP = 0xFF; //polarity select reg for(;;)
{
for(counter=0;counter<10000;counter++)
{
}
PTP |= 0x01;
for(counter=0;counter<10000;counter++)
{
}
PTP &= 0x00;
}
EnableInterrupts;
asm_main(); /* call the assembly function */
for(;;) {} /* wait forever */
}




Hi.

Adapt9S12E128 boards can be connected/programmed with:

1- uBug12 (onchip monitor talking to uBug12 software from Technological
Arts, via RS232),

2- with a BDM pod (Technological Arts MicroBDM12, P&E Multilink, SofTec
inDART-HCS12, Abatron BDI 1000, etc., etc.).

You can design a project with CodeWarrior but note that CodeWarrior does
not support the Technological Arts monitor communication protocol, so you
will not be able to download/debug directly your project or .abs file with
CodeWarrior (which supports P&E Multilink, SofTec inDART-HCS12, Abatron BDI
1000, HCS12 Serial Monitor).

However, uBug12 should let you download srecord files (.phy) created by
CodeWarrior when building the project.

You can have a look at:

http://www.technologicalarts.com/myfiles/AD9S12E128.html Regards,

Gilles At 05:18 AM 1/4/2005, you wrote: >I have just been given a Adapt9S12E128 for a project and I'm having
>trouble getting started. It came in a box with CodeWarrior CW12
>V3.0 and a cd with software(ubug12, demo apps) and datasheets.
>Following the steps provided on the CD I have not been able to load
>any of the demo programs onto the chip. I tried writting my own
>program using codewarrior and downloading it using ubug12 but still
>no luck. Do I have to move the jumpers around a bit or should i be
>using some other program other than ubug12 to download.
>
>Here is the simple program i generated using codewarrior's wizard.
>I was trying to turn the red LED on the development board on and off.
>
>Any tips on getting started would be great.
>
>Thanks heaps... >#include <hidef.h> /* common defines and macros */
>#include <mc9s12e128.h> /* derivative information */
>
>#include "main_asm.h" /* interface to the assembly module */
>
>#pragma LINK_INFO DERIVATIVE "SampleS12"
>
>void main(void) {
> /* put your own code here */
>
> int counter;
>
> PTP = 0x00; //port P i/o reg
> // PTIP //port p input can't write to this
> DDRP = 0xFF;//port p data direction reg
> RDRP = 0x00; //reduced drive reg
> PERP = 0x00; //port p pull device enable reg
> PPSP = 0xFF; //polarity select reg > for(;;)
> {
> for(counter=0;counter<10000;counter++)
> {
> }
> PTP |= 0x01;
> for(counter=0;counter<10000;counter++)
> {
> }
> PTP &= 0x00;
> }
> EnableInterrupts;
> asm_main(); /* call the assembly function */
> for(;;) {} /* wait forever */
>} >
>
>Yahoo! Groups Links






Thanks Gilles..

I seem to have solved my problem. Having played around with
CodeWarrior for a while I started creating serveral different
projects using the wizard, each with different setup options. One of
these options must have been the key to the problem because the code
below works now.

Just for the record in case anybody else is a total noob at this like
me...

After creating the project in CodeWarrior using the wizard I had
to 'make' the project without touching it first. This generated a
few extra files, one called "project-name.c" containing " /** user
code here **/ ". I put my flashing LED code here and hit make again.
This creates a .s19 file in the ./bin directory of the project. I
then ran the windows terminal ubug12.exe, typed 'con 1' to
connect, 'fbulk' to erase any existing program as per the
instructions on the CD, and click FILE->load->.s19 and loaded the
new .s19 file. Flicked the switch to run on the adapt board and
pressed the reset button.

If the code doesn't run at this stage, go back and create a new
project with different settings.. I included the processor expert
option, which may not be needed but gives nice pictures of available
i/o pins if nothing else. (im sure it does something usefull, just
haven't looked at it much yet. Saw something about beans? eh..)

Anyway, thats what I did. Hope this helps anybody else getting
started. Oh, and I was just using a serial cable, no bdm pod or
anything.

By the way I ended up adding a for loop or two which ended up being
90,000 loops of nothing so the LED flashed slow enough to see hehe.
--- In , Gilles Blanquin <gblanquin@m...> wrote:
>
> Hi.
>
> Adapt9S12E128 boards can be connected/programmed with:
>
> 1- uBug12 (onchip monitor talking to uBug12 software from
Technological
> Arts, via RS232),
>
> 2- with a BDM pod (Technological Arts MicroBDM12, P&E Multilink,
SofTec
> inDART-HCS12, Abatron BDI 1000, etc., etc.).
>
> You can design a project with CodeWarrior but note that CodeWarrior
does
> not support the Technological Arts monitor communication protocol,
so you
> will not be able to download/debug directly your project or .abs
file with
> CodeWarrior (which supports P&E Multilink, SofTec inDART-HCS12,
Abatron BDI
> 1000, HCS12 Serial Monitor).
>
> However, uBug12 should let you download srecord files (.phy)
created by
> CodeWarrior when building the project.
>
> You can have a look at:
>
> http://www.technologicalarts.com/myfiles/AD9S12E128.html > Regards,
>
> Gilles > At 05:18 AM 1/4/2005, you wrote: > >I have just been given a Adapt9S12E128 for a project and I'm having
> >trouble getting started. It came in a box with CodeWarrior CW12
> >V3.0 and a cd with software(ubug12, demo apps) and datasheets.
> >Following the steps provided on the CD I have not been able to load
> >any of the demo programs onto the chip. I tried writting my own
> >program using codewarrior and downloading it using ubug12 but still
> >no luck. Do I have to move the jumpers around a bit or should i be
> >using some other program other than ubug12 to download.
> >
> >Here is the simple program i generated using codewarrior's wizard.
> >I was trying to turn the red LED on the development board on and
off.
> >
> >Any tips on getting started would be great.
> >
> >Thanks heaps...
> >
> >
> >#include <hidef.h> /* common defines and macros */
> >#include <mc9s12e128.h> /* derivative information */
> >
> >#include "main_asm.h" /* interface to the assembly module */
> >
> >#pragma LINK_INFO DERIVATIVE "SampleS12"
> >
> >void main(void) {
> > /* put your own code here */
> >
> > int counter;
> >
> > PTP = 0x00; //port P i/o reg
> > // PTIP //port p input can't write to this
> > DDRP = 0xFF;//port p data direction reg
> > RDRP = 0x00; //reduced drive reg
> > PERP = 0x00; //port p pull device enable reg
> > PPSP = 0xFF; //polarity select reg
> >
> >
> > for(;;)
> > {
> > for(counter=0;counter<10000;counter++)
> > {
> > }
> > PTP |= 0x01;
> > for(counter=0;counter<10000;counter++)
> > {
> > }
> > PTP &= 0x00;
> > }
> > EnableInterrupts;
> > asm_main(); /* call the assembly function */
> > for(;;) {} /* wait forever */
> >}
> >
> >
> >
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
> >




In a message dated 1/4/05 7:50:59 A.M. Eastern Standard Time,
writes:

By the way I ended up adding a for loop or two which ended up being
90,000 loops of nothing so the LED flashed slow enough to see hehe.
================================================
Was the loop counter a long? Just curious.....





> ================================================
> Was the loop counter a long? Just curious.....

Nah, just an int. Did a for loop and copied and pasted it a couple
of times..




The 2024 Embedded Online Conference