Re: FPU problem urgent

"Julian Requejo" <[email protected]>
Newsgroups gmane.comp.hardware.motorola.microcontrollers
Message-ID <[email protected]>
The documentation is a bit tricky, because this is not in the MPC555 manual,
but rather in the PowerPC documentation. If you wanna learn more about FP
unit look at this doc. However, you will likely get confused. It is not easy
reading, but it is worth glacing over to get an idea. Keep in mind that this
is powerPC in general. Some aspects, like FP square root is not supported by
the MPC555.

The basic steps are as follows:
- Enable FP
   
mfmsr r3
ori   r3,r3,0x2002
mtmsr r3

- If IEEE model is not required, disable it.
mtfsb1  29

- When compiling, tell your compiler that you want floating point. For Diab,
you do this with
-tPPC555EH:simple

- If you are using a preemptive OS, there should be some option to tell the
OS that you are using FP. This will force the OS to save FP registers upon a
context switch.

- If inside an interrupt, re-enable FP as described above. You shouldn't do
FP inside an ISR anyway.

- FP vars are 32 or 64 bits. So if you have many of them, make sure to
allocate enough stack!

Besides this, I don't think you need to do much more to get FP working.
Someone else please contribute if I am missing something.
Cheers and happy FP,
-Julian


-----------------------------------------------------------
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.