Hello, I'm trying to modify the code from the official motor control demo.
The original demo uses 3 ADC channels, and I want to add an additional channel. Please see the table below.
original | expected | ||||
pin | adc channel | physical signal | pin | adc channel | physical signal |
PTA6 | ADC0_SE2 | i_ph_c | |||
PTB1 | ADC1_SE15 | i_ph_b | PTB1 | ADC1_SE15 | i_ph_b |
PTB0 | ADC0_SE4 | i_ph_a | PTB0 | ADC0_SE4 | i_ph_a |
PTB12 | ADC1_SE7 | v_bus | PTB12 | ADC1_SE7 | v_bus |
Here is what I have changed in processor expert.
add configuration for adc0_se2
add the associated pdb configuration
modify the adc peripheral configuration
modify the pdb peripheral configuration
You can find the archive file of the project in the attachment.
When I flash the binary file to the official demo kit, an error occurs, the software falls into the default ISR.
Can anyone helps to find the root cause?
By the way, I have disabled the adc interleave and the test result is ok, the motor can run.
I double checked your configuration and found no problem, I suggest that you can try single-step debugging first, locate the step where the exception occurred, send me a screenshot of the picture, and then I'll check if there is anything I haven't considered arrive.
You can also refer to the ADC pre-trigger configuration of the MCSPTE1AK144_BLDC_6Step,this routine can also be found in your install path,