Porting MKV31 Project to MKV56

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Porting MKV31 Project to MKV56

Jump to solution
1,072 Views
derekcook
Senior Contributor I

Hello, 

It looks like the MKV56 is a pin match to the MKV31 for our application. The only change I need to make is to use the high speed ADCs since the ADCs end up mapping to these and not ADC0 and ADC1. In my project I am using the ADC1 interrupt to control the motor PWM. Am I able to use the program delay block (PDB) to trigger an interrupt on the high speed ADCs? 

Also do you have an example motor control project using the MKV56? I see code written for ARM Cortex-M4 applications will work on ARM Cortex-M7 applications. I downloaded the MKV56 SDK and pointed my project to the MKV56 from the MKV31. However, do I need to change anything else related to the MCU within my project or can I use the MKV31 code on the MKV56? Everything compiles currently in MCUXpresso. Just trying to catch any issues while I'm waiting on hardware to test on. I'm basically wanting to use a project based on the hvpkv31f demo project on the MKV56.

MCU config

derekcook_0-1655141384204.png

 

Would it be ok to leave the Preprocessor defined symbols to MKV31F512 or will this cause issues? If I change this to MKV56F512 it causes build errors due to the below libraries not being found. The libraries are mostly all SDK functions. 

derekcook_1-1655141582611.png

These are not found if I change the build variables to MKV56:

derekcook_2-1655141637890.png

 

 

Tags (1)
0 Kudos
1 Solution
1,049 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi Derek,

Unfortunately there is no example that shows how to use the PDB to generate a HSADC trigger, only to generate an ADC trigger (SDK example pdb_adc16_trigger). However for HSADC you can refer to the Kinetis KV5x: 240MHz Arm® Cortex®-M7 up to 1MB Flash (144pin) reference manual section 41.1.4 Input triggering via PDB for more information.

Regarding your second question, I recommend you use the SDK examples of hvpkv58f, which uses ARM Cortex-M7, and it is compatible with MKV56, also has motor control examples. To change the MCU of the example I recommend the following thread: How to Change MCU with MCUXpresso.

I hope it helps you.

View solution in original post

0 Kudos
2 Replies
1,043 Views
derekcook
Senior Contributor I

Thanks for the reply! This is exactly what I did and I already have our application adapted for the KV56. I should have hardware in a few days to test it on. 

I created a new project for the KV56, reviewed sdk examples for the KV58, linked our application libraries over to the new project I created and adapted the driver code to the KV56 SDK. For the HSADC, since it is so fast I actually don’t need the PDB. I used a FTM to created a timed interrupt at the motor PWM frequency I needed, then added a fixed delay at the beginning of the interrupt like the PDB does before triggering ADC conversion to avoid switching currents and then triggered the ADC conversion. The data sheet says that this conversion should only take 900ns so it is so fast I can wait on the conversion to complete. 

0 Kudos
1,050 Views
_Leo_
NXP TechSupport
NXP TechSupport

Hi Derek,

Unfortunately there is no example that shows how to use the PDB to generate a HSADC trigger, only to generate an ADC trigger (SDK example pdb_adc16_trigger). However for HSADC you can refer to the Kinetis KV5x: 240MHz Arm® Cortex®-M7 up to 1MB Flash (144pin) reference manual section 41.1.4 Input triggering via PDB for more information.

Regarding your second question, I recommend you use the SDK examples of hvpkv58f, which uses ARM Cortex-M7, and it is compatible with MKV56, also has motor control examples. To change the MCU of the example I recommend the following thread: How to Change MCU with MCUXpresso.

I hope it helps you.

0 Kudos