Re: Where can I get a code sample for MPC555 PMM & PSP(in C language)?
"murphynetuk" <[email protected]>
| Newsgroups | gmane.comp.hardware.motorola.microcontrollers |
|---|---|
| Message-ID | <[email protected]> |
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 --- In [email protected], "needafcukingid" <digitalhot@t...> wrote: > --- In [email protected], "murphynetuk" <murphynetuk@y...> wrote: > > Application notes TPUPN14, TPUPN15A, TPUPN15B cover these functions. > > They appear in the 68332 section of the Freescale site. > > Ian > > > > > > Thanks, murphynetuk. > Those docs really help. But the examples are in asm, guess c codes may > be not free. Anyway, thanks again. ------------------------ Yahoo! Groups Sponsor --------------------~--> Most low income households are not online. Help bridge the digital divide today! http://us.click.yahoo.com/cd_AJB/QnQLAA/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/