Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

XMC™ Forum Discussions

Not applicable
Hello together,

I want to control a BLDC motor with a XMC4700 Relax Kit and Eval-M1-05F804 Board.
The motor shuld only be controled in the open loop with the PWM_BC APP but something is wrong. I can't get any signal out of the µC and don't know the reason for this.
Generally I tried to follow the example in the "APP-Help" as far as possible.


/*
* main.c
*
* Created on: 2018 Jul 24 11:01:09
* Author: Simon
*/
#include //Declarations from DAVE Code Generation (includes SFR declaration)

/**

* @brief main() - Application entry point
*
* Details of function

* This routine is the application entry point. It is invoked by the device startup code. It is responsible for
* invoking the APP initialization dispatcher routine - DAVE_Init() and hosting the place-holder for user application
* code.
*/

uint8_t pat_index = 1;
uint16_t duty_cycle = 300;
uint16_t ten_milli_count = 200;
uint32_t count = 0;

int main(void)
{
DAVE_STATUS_t status;

status = DAVE_Init(); /* Initialization of DAVE APPs */

if(status != DAVE_STATUS_SUCCESS)
{
/* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */
XMC_DEBUG("DAVE APPs initialization failed\n");

while(1U)
{

}
}

PWM_BC_Start(&PWM_BC_0); // synchronous start for the CC8 slices.

/* Placeholder for user application code. The while loop below can be replaced with user application code. */
while(1U)
{


}
}

void PWM_PeriodMatchISR(void)
{
if(count > ten_milli_count) /*Check if it is time to apply next pattern?*/
{

if(pat_index > (uint8_t)6) /*Check if pattern index is greater than 6*/
{
pat_index = (uint8_t)1;
}

PWM_BC_SetNextMCPatt(&PWM_BC_0,pat_index); /*Sets the MCM pattern to shadow register*/
PWM_BC_ModulationForSyncTransfer(&PWM_BC_0); /*Compare value update*/
XMC_POSIF_MCM_UpdateMultiChannelPattern(POSIF0);/*Immediate Shadow transfer*/

/*Apply dutycyle*/

PWM_BC_DutyCycleUpdate(&PWM_BC_0,duty_cycle);
pat_index++;
count = 0;
}

else
{
count++;
}
}


What could be the reason for this issue?

Some additional settings:


PS: Sorry for my bad english!

Kind regards
0 Likes
0 Replies