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 know if your code in another state has been implemented using PM_sensorless code with F28035 control card?

Other Parts Discussed in Thread: DRV8312

Hello,

I am doing a final project where I am to implement regenerative braking using the F28035 control card, PM_sensorless project and DRV8312 board.

I have thoroughly analyzed the code thus far and I realized that I would have needed a new flag - BrakeFlag to manually switch between forward motoring mode and regnerative (braking mode). I understan the Enable FLag has alot of power and when it is zero, no further interrupts/ operation of the motor can be done. (to my understanding)

I wanted to create a new brake flag, so that when this is 0 --> the enable flag would be 1 and assume normal operation...but when it the brake flag is 1, it would perform a separate set of operations. 

I would just like to confirm that this can be done using some new code in another state (e.g. state B1), or should i implement the new flag in state A1, which is the same state as  the enable flag?

How would I know that the brake flag's state has been successfully implemented?