Other Parts Discussed in Thread: DRV8332
Hi.
I am currently in the process of developing a more-or-less standalone N2HET application that controls a sensored 3 phase BLDC motor using the DRV8332 driver.
For this application, I need to produce the following commutation sequence according to the U, V, W hall effect inputs:
Therefore, I need to turn on/off the PWM outputs for 3 pins: PWM_A, PWM_B, and PWM_C according to the 3 hall sensor inputs.
To test this concept, I made the following N2HET program. It simply turns on the PWM output (pin 2) whenever the input (pin 0) is low and vice versa:
PIN_EN .equ 0 ; ENABLE PIN_PWM_OUT .equ 2 ; PWM OUTPUT PWM_DATA .equ 15 ; Data for PWM PWM_HRDATA .equ 0 ; HRData for PWM ; ********* START: Global counter for PWM ********* START CNT { reg = A, max = 19, data = 0 } PWM ECMP { hr_lr = HIGH, en_pin_action = ON, pin = PIN_PWM_OUT, action = CLEAR, reg = A, data = PWM_DATA, hr_data = PWM_HRDATA } ; ********* ENABLE PIN is low - Output PWM Signal ********* ENABLE BR { next = DISABLE, cond_addr = PWM_ON, event = Low, pin = PIN_EN } PWM_ON DADM64 { remote = PWM, en_pin_action = ON, pin = PIN_PWM_OUT, comp_mode = ECMP, action = PULSELO, reg = A, data = 0 } ; ********* ENABLE PIN is low - Output PWM Signal ********* DISABLE BR { next = START, cond_addr = PWM_OFF, event = High, pin = PIN_EN } PWM_OFF DADM64 { next = START, remote = PWM, en_pin_action = ON, pin = PIN_PWM_OUT, comp_mode = ECMP, action = CLEAR, reg = A, data = 0 }
However, I get this weird output:
Notice the increasing undesirable amount of delay (highlighted in yellow).
How do I fix this problem?
Thank you very much for your time and help,
Jae