MK60:UART Rx don't trigger DMA

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

MK60:UART Rx don't trigger DMA

1,810 Views
泽铭柳
Contributor I

I have a DT7 & DR16 RC System | DJI. The DR16 receiver use D-Bus protocol. For communicate with  the receiver, the signals need to be negated. I use a transistor inverse circuit, the following is the  schematic diagram.

19143_19143.jpgQQ截图20150126143240.jpg

I use UART receive trigger DMA. But UART don't trigger DMA. I did some tests:


1. UART interrupt receiver, in the interrupt handler of UART_Rx, the MCU receives correct data. so I think the transistor inverse circuit work.

2. UART receive trigger DMA, in this case, I use PC transmits and MCU receives, in the interrupt handler of DMA, the MCU receives correct data.

3. UART receive trigger DMA, I use other MCU transmit and this MCU receives by using 100k baud rate, in the interrupt handler of DMA, the MCU receives correct data.

4. UART receive trigger DMA, when I use the DR16 transmit and MCU receives(8bit), I find UART Rx don't trigger DMA.

5. UART receive trigger DMA, but when I use the DR16 transmit and MCU receives(9bit), I find UART Rx can  trigger DMA.

 

I have checked my program for many times , but I still did't find why this happen, please help me.



Original Attachment has been moved to: UART_Remote_test.zip

Labels (1)
Tags (2)
0 Kudos
9 Replies

1,104 Views
泽铭柳
Contributor I

Can anyone help me?:smileycry:

0 Kudos

1,104 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

I'd like to confirm something with you after I reviewed your testing resulting.

1. Can the data from the DR16 trigger the receive interrupt when UART work in 8-bit protocol ?

2. Was the data receive correct or not when UART work in 9-bit protocol? You can use logic analyzer to make these comparison.

3.

QQ截图20150126143240.jpg
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,104 Views
泽铭柳
Contributor I

Hi Ping,

1. Yes. Only UART without DMA, DR16's data can trigger the receive interrupt when UART work in 8-bit protocol.

2. MCU can receive correct data when UART work in 9-bit protocol.But sorry,I don't have a logic analyzer.

3. When I use NOT gate, MCU didn't receive correct data in UART receive interrupt handler. But I found that MCU can receive some bytes data of full 18 bytes when configure DMA receive UART Rx.

So I think may be the transistor inverse circuit has some error.

Best regards,

Zeming.

0 Kudos

1,104 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

I've learned that the UART didn't receive correct data when DR16 transmit data through the NOT gate to UART pin even the UART receive interrupt could be triggered from your statement.

So I guess the NOT gate transmission delay time cause this issue and I'd like to suggest that you can give a another shot after use 100 Ohms instead of the resistor that connect the transistor with Head 3.

Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,104 Views
泽铭柳
Contributor I

Hi,Ping,

I use 100 Ohms resistor replaced the 4700 Ohms resistor which connect the transistor with Head 3, UART Rx still can't trigger DMA.

Best regards,

Zeming

0 Kudos

1,104 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

I think the most important thing we should get to know is which protocol of data transmission the DR16 use, the 8-Bit or 9-Bit and its precise baud rate.

If we get these information, you can use the PC or other MCU to simulate the DR16 to transmit the data to K60.

According to your testing results, I've learned that it's not hard for you to create a project about receiving the data correctly from either the PC or the other MCU through the DMA operation.

After the previous steps done, I think the project can also receive the data correctly which from the DR16 if the NOT gate work fine.

Wish it helps.
Have a great day,
(my name)

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,104 Views
泽铭柳
Contributor I

Hi,Ping,

1. DR16: 8-Bit , 100Kbps.

2. K60's DMA can be triggered by PC or STM32 which simulate the DR16 to transmit the data to K60.

3. The NOT gate work fine, but K60 stall don't receive correct data.

Thanks for you help.

Best regards,

Zeming

0 Kudos

1,104 Views
jeremyzhou
NXP Employee
NXP Employee

Hi ,

It seems like that we fell in black hole now and I think we will still have no idea to move forward if we don't know the exactly the wave of the data which the DR16 transmits and through the NOT gate.

So I'd like to suggest that you should use logic analyzer to capture the waves of DR16 and simulated, then make a comparison.

Hope it helps.
Have a great day,
Ping

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,104 Views
泽铭柳
Contributor I

Hi,Ping,


Thanks for yous help. I will try to solve the problem.

Maybe it's time for me to buy a  logic analyzer. :smileyhappy:


Best regards,

Zeming

0 Kudos