Re: Where can I get a code sample for MPC555 PMM & PSP(in C language)?

"needafcukingid" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
--- In [email protected], "murphynetuk" <murphynetuk@y...> wrote:
> Any C code you may come across for the TPU will simply be a macro 
> mapping to direct writes to the memory-mapped registers of the TPU.
> So e.g. to write to the PRAM[5][5] of TPU_A
> 
> e.g. from the TPUPN14 appnote:
>   PRAM5_5 equ $ffff4a  ->  is just assigning a convenient name to 
> $ffff4a (note this is the address for a 68332 NOT an MPC5XX)
>   move.w #$0200,(PRAM5_5).l  ->  is writing the value '$200' to 
this 
> location
> 
> e.g. from the MPC5XX header files:
>   TPU_A.PARM.R[5][5] = $200;
> (the header files will assign the correct address for you)
> With the Macro expanded this becomes:
> (*( struct TPU3_tag *) (0x00000000 + 0x304000)) .PARM.R[5][5] = 
0x200;
> Which compiles to:
> 
> e.g. from the MPC5XX 'quickstart' app:
>   TPUSetParam(TPU_A, PSP, HIGH_TIME, $200);
> (the quickstart code maps everything conveniently by name)
> With the Macro expanded this becomes:
> *TPU_A_PRMADDR_PSP_HIGH_TIME_CFG0 = 0x200;
> Which again compiles to:
> li       r0,512
> lis      r3,48
> sth      r0,16730(r3)
> 
> So it's all the same!
> Learning and understanding that all you are ever doing is reading / 
> writing memory-mapped registers is key to TPU programming.
> Ian

I got it, murphynetuk, thanks a lot...
So I can write it myself. :)




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/dN_tlB/TM
--------------------------------------------------------------------~-> 

-----------------------------------------------------------
To learn more about Freescale Microcontrollers, please visit
http://www.freescale.com/mcu


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/MPC500/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.