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.

TMS320F28379D: Combining DriverLib and Bitfield Examples

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

I have a large existing project which was originally started based on the bitfield epwm_deadband example. I now want to add USB logging functionality, for which the usb_ex4_dev_bulk example provides a useful starting point. The problem is that I am not sure what the procedure is to combine a bitfield example project with a driverlib example project, if this is even possible.

I started by duplicating the usb_ex4_dev_bulk example project, then I copied in all the files present in the epwm_deadband example project. Then I adjusted the build settings to include the headers referenced by both projects. The problem is I now get two errors when building the project. They are both "expected an identifier" erros in adc.h in the driverlib:

"C:/ti/C2000Ware_3_03_00_00_Software/driverlib/f2837xd/driverlib/adc.h", line 176: error #41: expected an identifier

I suspect this is because the driverlib headers cannot be used at the same time as the bitfield headers? Do I have to commit fully to driverlib to take advantage of the USB2.0 peripheral and rewrite my existing project in driverlib? Or is there a procedure to mix driverlib and bitfield projects?

  • Hi,

    I am not aware of anyone who has combined both these approaches - bitfield and driverlib but it is feasible. You will have to make sure that the header file names are not same for the bitfield and driverlib.  In case the names are same, you will have to rename them to make sure that the correct header file is referenced.

    Best Regards

    Siddharth

  • If this is not a common approach, then I think it will be best if I port my existing code to use driverlib - it is only some simple config for the ADC, DAC and PWM that will have to be redone. The rest of the control code will not be affected. The requirement for USB was a late addition to the project, otherwise I would have used driverlib from the start.

  • Hi Euan,

    Do note that the bit-field & driverlib approaches were designed in a way such that they can work together.  There are some customers that have preferred this for reasons like you're describing (reuse of already developed code, etc).

    You can refer to the following thread for more information:
    https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/889632

    Hopefully this helps!


    Thank you,
    Brett