Reply by jpdi December 26, 20072007-12-26
Hi, Edward !

Thank you for your answer.
I know ICC12 V6 doesn't suppor XGate asm.
I tried with demo version of V7, but without any documentation...

I'd like to have some XGATE assembler examples (under ICC12 would be better)
! If you have it, it would be great !

I tried Cosmic compiler, which support XGATE C compiler, and CodeWarrior,
but both are very very expensive for me !
With these tools, I begin to understand XGate, but some details missed me,
and seems to be important if I don't use "heavy" compilers ! Your answer
lights me now.

I think interrupt thread I've to write aren't so long... Simply
receive/transmit on one SCI chanel...

By the way, it seems there are mistake with ICC12 V7 under target "XDP512" :
OK Program memory 0x4000.0x7FFF:0xC000.0xFFFF
Bad ? Data memory 0x0800 (I suppose 0x1000, it's OK with
that)
OK stack 0x4000

A question about Expanded Memory : 0xf0000.0xfffff ?
Are this datas correct for ICC12 V7 ?I don't understand this parameter, and
help files don't explain that..

Thank you,
And all the best for you for the new year !
Best regards

Joel
> -----Message d'origine-----
> De: 6... [mailto:6...] De la part de
> Edward Karpicz
> Envoy mercredi 26 dembre 2007 21:38
> : 6...
> Objet: Re: [68HC12] XGate programming and XDP512 memory scheme
>
> Hi Joel,
>
>
> > Hello !
> >
> > Until now, I was using mc9s12dp256 with ICC12 V6 professionnal, paged
> > programm, and all was ok.
> >
> > Now, using mc9s12xdp512cal, with ICC12 professionnal V6, I need to use
> > XGate
> > processor (communication SCI between 2 MCU). Without XGate, the main S12
> > CPU
> > would be overload !
> >
> > I read the Freescale datasheets, specially the chapters about :
> > - XGate,
> > - Memory Mapping Control
> > - Interrupt
> > - and some Application Notes about XGate
> >
> > It seems to be difficult to know how to program that XGate processor. I
> > looked for some samples without any success !
>
> Are you trying to code XGATE in C with ICC12? Unfortunately ICC12 doesn't
> support XGATE at C level. ICC12 V7 does have some support for XGATE asm,
> but
> not C :-(.
>
>
> > The samples I can analyse (Cosmic and CodeWarrior) give a little bit of
> > informations (just one sample program), but are not very clear at all,
> > specially memory access, memory mapping...
>
> S12X with XGATE is quite a difficult thing, a lot of reading until you see
> the whole picture.. You write S12X and XGATE interrupt handlers, make S12X
> interrupt vector table, XGATE vector table, setup XGATE, interrupt
> controller and interrupt routing.
>
> >
> > If I understood, for XGate point of view :
> > - 2K registers are under address 0x0000..0x07ff
> > - 30k flash for XGate from xgate address 0x0800..0x7fff
> > - 32K RAM of the XDP512 are under address 0x8000..0xffff,
>
> ^^ That's right. XGATE has 16bits address space and XGATE sees registers,
> ram and flash at addresses you wrote above. What S12X sees as RAM @ $3FFF,
> XGATE sees as RAM @ $FFFF. What XGATE sees as flash @ $7FFF, S12X sees @
> PPAGE $E1, $BFFF :-).
>
>
> >
> > I understand all the RAM available on XDP512 can be access with XGate,
> and
> > the pagination system (RPAGE) to access RAM under S12 CPU.
>
> That's right. Also there's a new global addressing mode. S12X is able to
> see
> all the onchip 32k RAM in GPAGE = $F, offset $8000-$FFFF.
>
> >
> > I don't completely understand the memory scheme of XDP512.
> > I know there are 512K flash, but I don't see anything about the
> different
> > pages. DP256 had internal pages from 0x30..0x3f, with window
> > 0x8000..0xc000,
> > but XDP512 ? It seems to be pages 0xe0..0xfd, same window ? Correct ?
>
> Correct. PPAGEs $E0-$FF, page window $8000-$BFFF. Note one more small
> difference between S12 and S12X. Fixed page 4000-7fff was mapped to
> PPAGE=the_top_most_ppage-1=$3E on S12. Now 4000-7fff is mapped to
> PPAGE=the_top_most_ppage-2=$FD on S12X.
>
> >
> > Any help ?
> > All samples about XGate wil be welcome !
>
> Do you wish XGATE assembler examples? ICC12 doesn't have C compiler for
> XGATE, unfortunately.
>
>
> Best Regards
> Edward
>
> >
> > With all my thanks
> > Best regards
> >
> > Joel Petrique
> >
> >
>
>
>
>
>
>
Reply by Edward Karpicz December 26, 20072007-12-26
Hi Joel,
> Hello !
>
> Until now, I was using mc9s12dp256 with ICC12 V6 professionnal, paged
> programm, and all was ok.
>
> Now, using mc9s12xdp512cal, with ICC12 professionnal V6, I need to use
> XGate
> processor (communication SCI between 2 MCU). Without XGate, the main S12
> CPU
> would be overload !
>
> I read the Freescale datasheets, specially the chapters about :
> - XGate,
> - Memory Mapping Control
> - Interrupt
> - and some Application Notes about XGate
>
> It seems to be difficult to know how to program that XGate processor. I
> looked for some samples without any success !

Are you trying to code XGATE in C with ICC12? Unfortunately ICC12 doesn't
support XGATE at C level. ICC12 V7 does have some support for XGATE asm, but
not C :-(.
> The samples I can analyse (Cosmic and CodeWarrior) give a little bit of
> informations (just one sample program), but are not very clear at all,
> specially memory access, memory mapping...

S12X with XGATE is quite a difficult thing, a lot of reading until you see
the whole picture.. You write S12X and XGATE interrupt handlers, make S12X
interrupt vector table, XGATE vector table, setup XGATE, interrupt
controller and interrupt routing.

>
> If I understood, for XGate point of view :
> - 2K registers are under address 0x0000..0x07ff
> - 30k flash for XGate from xgate address 0x0800..0x7fff
> - 32K RAM of the XDP512 are under address 0x8000..0xffff,

^^ That's right. XGATE has 16bits address space and XGATE sees registers,
ram and flash at addresses you wrote above. What S12X sees as RAM @ $3FFF,
XGATE sees as RAM @ $FFFF. What XGATE sees as flash @ $7FFF, S12X sees @
PPAGE $E1, $BFFF :-).
>
> I understand all the RAM available on XDP512 can be access with XGate, and
> the pagination system (RPAGE) to access RAM under S12 CPU.

That's right. Also there's a new global addressing mode. S12X is able to see
all the onchip 32k RAM in GPAGE = $F, offset $8000-$FFFF.

>
> I don't completely understand the memory scheme of XDP512.
> I know there are 512K flash, but I don't see anything about the different
> pages. DP256 had internal pages from 0x30..0x3f, with window
> 0x8000..0xc000,
> but XDP512 ? It seems to be pages 0xe0..0xfd, same window ? Correct ?

Correct. PPAGEs $E0-$FF, page window $8000-$BFFF. Note one more small
difference between S12 and S12X. Fixed page 4000-7fff was mapped to
PPAGE=the_top_most_ppage-1=$3E on S12. Now 4000-7fff is mapped to
PPAGE=the_top_most_ppage-2=$FD on S12X.

>
> Any help ?
> All samples about XGate wil be welcome !

Do you wish XGATE assembler examples? ICC12 doesn't have C compiler for
XGATE, unfortunately.
Best Regards
Edward

>
> With all my thanks
> Best regards
>
> Joel Petrique
Reply by jpdi December 26, 20072007-12-26
Hello !

Until now, I was using mc9s12dp256 with ICC12 V6 professionnal, paged
programm, and all was ok.

Now, using mc9s12xdp512cal, with ICC12 professionnal V6, I need to use XGate
processor (communication SCI between 2 MCU). Without XGate, the main S12 CPU
would be overload !

I read the Freescale datasheets, specially the chapters about :
- XGate,
- Memory Mapping Control
- Interrupt
- and some Application Notes about XGate

It seems to be difficult to know how to program that XGate processor. I
looked for some samples without any success !
The samples I can analyse (Cosmic and CodeWarrior) give a little bit of
informations (just one sample program), but are not very clear at all,
specially memory access, memory mapping...

If I understood, for XGate point of view :
- 2K registers are under address 0x0000..0x07ff
- 30k flash for XGate from xgate address 0x0800..0x7fff
- 32K RAM of the XDP512 are under address 0x8000..0xffff,

I understand all the RAM available on XDP512 can be access with XGate, and
the pagination system (RPAGE) to access RAM under S12 CPU.

I don't completely understand the memory scheme of XDP512.
I know there are 512K flash, but I don't see anything about the different
pages. DP256 had internal pages from 0x30..0x3f, with window 0x8000..0xc000,
but XDP512 ? It seems to be pages 0xe0..0xfd, same window ? Correct ?

Any help ?
All samples about XGate wil be welcome !

With all my thanks
Best regards

Joel Petrique