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.

OC_MODE change on DRV8301

Other Parts Discussed in Thread: DRV8301, MOTORWARE, TMS570LS3137

I am using the DRV8301-LS31-KIT with the supplied motor. 

I am trying to control multiple H-Bridges with DRV8301 chip.  I added wires to the GH and GL lines on the PCB.  When I connect one GH and GL line to my additional H-Bridge circuit PCB, I get a Fault indication which I believe is an OC fault.  My additional board uses a battery for a supply so it is isolated from the main board DC power supply.  The sense lines SH_ and SL_ are only connected on the main board. 

I want to change the OC_MODE (as stated in TI app note SLVA552) to D4=0 & D5=1 for report only.

Using CCS, which file does this control register reside?

Thanks

Alan

  • Alan,

    You cannot directly view the DRV8301 registers from CCS. To view or change the content of DRV8301 registers, you need to set up SPI port to communicate with DRV8301. You need to check DRV8301 datasheets for the access sequence.

    Thanks and regards,

    Zhaohong

  • Hi Alan,

    The communication with the DRV8301 is implemented with SPI communication. This SPI communication is emulated using the high-end timer (N2HET module) on the DRV8301-LS31-KIT demo. You can find the N2HET assembly source code in the 8301.het file in the C:\ti\Hercules\MotorWare\v1.0.3.03\sw\drivers\het\src\32b\hercules\tms570ls3137 folder (assuming that you installed MotorWare under C:\ti, the default location).

    Open this file and find the "SPI codes" section. There are comments in this section that describe the writes to the two control registers in the DRV8301. You can see that 0x13D8 is written to control register 1 and 0x180D is written to control register 2.

    This chooses "latched shutdown when overcurrent is detected". If you need to change this selection, you will need to write 0x13E8 to control register 1. Note that the actual value transmitted via SPI needs to be "translated" as described in the comments section in the 8301.het file into a 25-bit value that will be written to the data field of the SHFT instruction. (this is 0x027D000 for 0x13E8).

    Once you update the .het file, you will need to assemble it using either the stand-alone NHET assembler or use the NHET IDE (recommended). You can even debug and view the operation of the NHET code using the NHET IDE.

    Assembling the updated 8301.het file will generate updated 8301.c and 8301.h files, which are already included as part of the source code for the demo project in CCS. You can then recompile the entire project and download it into the LS3137 MCU.

    Hope his helps.

    Regards, Sunil

  • Sunil,

    That was a big help.  I am not a software person so I am on the learning curve.  I have edited the 8301.het file by using the HET IDE compiler.  New .c and .h files have been created. 

    So do I now have to re-compile the TMS570LS Instaspin project using CCS?  Open the project, assemble and save?

    I presume that there is a library file that points to the directory where the 8301 files are.

    Alan

  • Alan,

    Yes, you do need to recompile the CCS project and then download the resulting .out file into the LS31x MCU's flash memory. The 8301.c file is already included as part of the CCS project source files. This is a linked file and is directly picked from the folder in which the updated 8301.c file is created.

    Regards,

    Sunil

  • understood.  So in CCS, I opened TMS570_instaspin_bldc. 

    Project/Clean

    Project/Build All

    All files in C:\ti\Hercules\MotorWare\v1.0.3.03\sw\solutions\instaspin_bldc\boards\drv8301kit_revD\hercules\tms570ls3137\projects\ccs5\project01\Debug have been updated. 

    In the above directory, I see TMS570_instaspin_bldc.out.  How do I download this file into the LS31x MCU's flash memory?

    Thanks

    Alan

     

  • Alan,

    Sorry lost track of this thread. From within CCS, you can click

    Run --> Load Program

    and then choose the last generated .out file from the correct folder. This will first erase the flash contents and then reprogram it with the new out file.

    Regards, Sunil