This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28375D: FPU Status Register Access

Part Number: TMS320F28375D

Hi -

I'm looking for a way to access the FPU's STF register using C.  I would like to monitor the LVF flag, and I can't find a way to access the register other than to monitor it in the CCS Registers View.  Also, do you have any pointers for setting up the PIE controller to handle an FPU overflow interrupt?

Thanks,

Chuck

  • Chuck,

    I think the only way is to write a short assembly function to read STF and copy it into ACC. The following would do it:

    .global _getSTF

    _getSTF:
    MOV32 *SP++, STF
    POP ACC
    LRETR

    You then need to declare the function in your C code:
    extern unsigned long getSTF(void);
    unsigned long lVar;

    ...and call the function where needed:
    lVar = getSTF();

    You could then test bit 0 to get hold of the LVF flag.

    Regarding the LVF interrupt, the original post you cited has most of the relevant information. Your C code to initialize the ISR would be something like:
    EALLOW;
    PieVectTable.LVF = &lvf_isr;
    EDIS;
    PieCtrlRegs.PIEIER12.bit.INTx7 = 1; // enable PIE INT 12.7 (LVF)
    IER |= M_INT12;

    Hope this helps.

    Regards,

    Richard
  • Hi Richard,

    I decided to just use the LVF interrupt to get overflow notification.

    Thanks for the help,
    Chuck