Hi All,
The following code was used to implement the motor control braking function on F2812. Does anyone know whether or not it can be done on F28027?
Thank you very much.
Luke Zhou
//
// OSU PEEM RELEASE
// Intended for evaluation purposes
//
//###########################################################################
//
// FILE: shutdown.c
//
// TITLE: DSP28 Emergency Shutdown Functions.
//
//###########################################################################
//
// Ver | dd mmm yyyy | Who | Description of changes
// =====|=============|======|===============================================
// 1.00| 06 Jan 2005 | S.C. | EzDSP Alpha Release
//###########################################################################
#include "DSP28_Device.h"
//---------------------------------------------------------------------------
// shutdown: Disable all PWM functions and all output pins
//---------------------------------------------------------------------------
void shutdown(int mode, int *enable_flg)
{
// EALLOW; // This is needed to write to EALLOW protected registers
// EDIS; // This is needed to disable write to EALLOW protected registers
// User specific functions, Reassign vectors (optional), Enable Interrupts:
// Initialize EVA Timer 1:
// Setup Timer 1 Registers (EV A)
if (mode == 0)
{
EvaRegs.COMCONA.all = 0;
*enable_flg = 0;
}
else if (mode ==1)
{
EvaRegs.ACTRA.all=0x0ccc; // Enforced to braking mode
}
}