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.

TMS320F2800137: FASTINTDIV

Part Number: TMS320F2800137
Other Parts Discussed in Thread: C2000WARE

Does the tms320f2800137 have FASTINTDIV support?which datasheet can check?

  • Hello Youjun,

    We do not document specifically the FASTINTDIV in the datasheet for any device, but it looks like the F280013x does have FASTINTDIV support (you should be able to enable it using the --idiv_support compiler option in the Project Properties). The FASTINTDIV is only usable when FPU32 or FPU64 is available (which is the case for this device, you just need to configure the --fpu_support to be fpu32 and set --abi=eabi).

    Best regards,

    Omer Amir

  • the FASTINTDIV must be used the stdlib.h?for example

    c = a/b;

    c = modulo div i16byi16(a,b)

    has the two methord thesame effect?

  • and I test the fastintdiv_example in f280013x in c2000ware5.0,the simulation result:passcount = 0 and success =0;

    why?

  • has the two methord thesame effect?

    No, modulo takes the modulo of a and b where both variables are 16-bit integers. The first line of your example is normal division, the second is modulo.

    and I test the fastintdiv_example in f280013x in c2000ware5.0,the simulation result:passcount = 0 and success =0;

    Did you make sure that the idiv_support is configured correctly? If you step through the code manually, can you see the specific incorrect results? Can you step through the assembly code to make sure the registers are changed as expected?

  • I import ccs project from the example and not change any configure ,the simulation result:passcount = 0 and success =0;

  • It seems that, based on some testing within the example, whenever a variable is used to do division the division/modulo is not performed correctly. For some reason, the disassembly shows that there is a very small number multiplied with the dividend:

    This was the code I used:

    int16_t a = -512;
    int16_t b = 20;
    int32_t res = 0;
    
    res = a / b;
    res = -512 / 20;

    For some reason using literal values works, but using variables causes the compiler to output code that makes the result of the division 0, which is why all the tests are failing. I'm not sure why this is happening, I will forward this question to the compiler experts since this does not seem isolated to this specific C2000Ware example.

  • OK,Find the reason and tell me promptly

  • I've confirmed that this issue occurs on the F280013x and F28004x device, it may be the case that these devices actually don't have FASTINTDIV support (as shown by the datasheet features page, where a device like F2838x device does have this listed). I will confirm this and try to update the example list for the FASTINTDIV library.

  • Hello Youjun,

    I have confirmed that the devices which contain the FASTINTDIV support are F2838x, F28002x, F28003x, and F28P65x. Other devices do not have this support and should be showing a warning when idiv0 is selected. I will work with the software team to address this. I will close this post, if you have further questions feel free to ask.