So I’m looking to write to the control register of the DRV8301 with a slightly new value without overwriting the OCP settings. I want to reduce the Gate Current from default (1.7A) to 0.7A by writing the appropriate value to it. Ben has already set up the structure to do this with defined functions and he does this to set the OC values like in the code above. Below is the register map of the control register I want to write to. My understanding of bitwise operations are rusty and I don’t quite understand how or what Ben is writing to this register after all the bitwise operators and bit shifting. Does anyone know anything about this or how to help? The goal is to reduce the gate drive strength in order to increase rise/fall times for some custom hardware I'm designing. This can help reduce voltage spikes and ringing on the switch nodes by increasing dt in the V = L*di/dt equation of voltage created from inductance and changing currents.
If you only want to change the gate drive current the only change you need to make is to write a 1 into bit 0 at register 0x02.
In the line before drv8301_write_reg() in your pic, add the line
Bits 1-15 are untouched since they are OR with zero.
In drv_8301_init(), it looks like 0x0430 or (0100 0011 0000) goes into the 11 data bits. You can change this to 0x0431 to initialize the vesc with 0.7A gate drive on boot.
Thanks @district9prawn! Ah yes now I remember the or-equals operator. I'll change the value in the init function to 0x0431 as suggested. I need to brush up on my digital stuff...
Thank you @district9prawn! Exactly what I needed to know.
valentines day gifts for her
Gate drive value in control register, Coding and more important things are mentioned here also. I would like to implement this code here because it is really interesting for brillassignment reviews. I want to built your interest first and after that it just be look that we all are waiting to having and also to keep these related pages.