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.

How to get PARTNO value for PARTID register

Other Parts Discussed in Thread: TMS320F2808

I have configured and selected device for TMS320F2808. But while debugging I am not able to get

DevEmuRegs.PARTID.bit.PARTNO=PARTNO_2808

where #define PARTNO_2808 0x3C

I am using TI TISRC folder and its source files as DSP280x_sysCtrl.c file. This register gives me value as 0 or 255 but not 0x3c.

Please help.

Regards

Newbee

  • NewBee,

    The PARTID register is a read-only register.  See the TMS320F280x System Control User's Guide, SPRU712G, p.115.  Your code is trying to assign a value to the PARTNO field, and you cannot do this.

    You can read the PARTNO field:

    Uint16 temp;
    temp = DevEmuRegs.PARTID.bit.PARTNO;

    When I run the above code on a F2808, I get temp = 0x3C which is the correct value for F2808.

    Regards,

    David

  • Hello David

    Thanks for yor reply.

    But I am not assigning value anywhere in code. I am just comparing 0x3C value with PARTID bit.

    I could see 0x3c val in register settings but if i hover the mouse on code bit value i get 0. so my condition get false.

    Please check snap shot.

    Please reply

    Newbee

  • NewBee,

    Since the CCS register window is showing the correct value, there is nothing wrong with the hardware.  Sounds like you don't have the peripheral header structures linked correctly.  If you add &DevEmuRegs to the watch window, do you get the correct address?  Also, what's with all the warnings showing in the Console window?  It's always a bad idea to ignor compiler warnings.  Maybe you forgot to include the linker .cmd file for the peripheral header files (DSP280x_Headers_nonBIOS.cmd) in your project?

    Regards,

    David

  • NewBee,

    Welcome to C.  In C, the == operator means 'check for equality', while the = operator means assignment.

    So you want:

    if (DevEmuRegs.PARTID.bit.PARTNO == PARTNO_2808) {

        // Part is 2808

    } else {

       // Part is something else

    }

    Regards,

    Bill

  • thanks for your replies.

    But I am using ITSRC file where comparison is only done.

    Well... I have resolved that problem as DSP280x_Headers_BIOS.cmd file was missing in project folder.

    Newbee