frdm kv31f UART Rx

cancel
Showing results for 
Search instead for 
Did you mean: 

frdm kv31f UART Rx

689 Views
onkarpatil
Contributor I

pdrake‌ : Please help, I am a student & working on KV31F UART1 Rx.

I am using the base code from MCUExpresso SDK for frdmkv31f_demo_app_mc_pmsm

Keeping most of code same I changed following things :

1. Configured UART1 Rx to PTE1 - using Pin configuration.

2. UART1 config

3. reading data using                  ui8UARTRead = UART_ReadByte(UART1);

4. taking action if ui8UARTRead has certain value.

Please let me know where I am going wrong?

Hereby I am attaching main.c

Please help it will be highly appreciated.

#frdm-kv31#uart_polling

Labels (1)
0 Kudos
3 Replies

451 Views
philip_drake
NXP Employee
NXP Employee

To configure a UART there are a number of steps.  Some of the better explanations are in the reference manual(see Functional Description sections of the UART) and the KQRUG(Look in chapter 12).

1)  Unfortunately there was no UART support built into this project.  If I were you I would look at the project Hello World and copy what they did for the UART. Or Option 2 (MCRSP_PMSM_V1.2.0) below which has full freemaster interface control built in.

So When you create the hello_world project in MCUXpresso IDE check the UART in the SDK Debug Console?

uart_sdk.png

2) As you tried, use the Pins Config Tool to change the pins to be used for the UART both TX and RX. Soon there will be a peripheral tool that will aid you to do all of the setup for the various peripherals.

select pins_tool.png

Options:

1) If you are wanting to control a motor and do not have experience with motor control can I suggest using Kinetis Motor Suite. 

2) The PMSM demo project in the sdk is a base example that is not outfitted with a freemaster control.

The other place to get a demo and a full motor control reference design is here: MCRSP_PMSM_V1.2.0

3) Motor control Training

I hope this helps

Best Regards,

PhilipPhilip Drake

0 Kudos

451 Views
onkarpatil
Contributor I

Hello,

Thank you for your ans.

I could able to make the motor work / control as per my needs. but what I

am trying to achieve is KV31F should receive input on UART and then it

should operate the motor based on received speed.

But I am not able to receive data on UART.

Regards,

Onkar Patil

0 Kudos

451 Views
philip_drake
NXP Employee
NXP Employee

Then definitely look at and duplicate the UART set up in hello world or other UART SDK demo code, coping it to the motor project.

Regards,

Philip

0 Kudos