LPC54102 PIN_INT_0 triggers I2C Master to Read from I2C Slave

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC54102 PIN_INT_0 triggers I2C Master to Read from I2C Slave

463 次查看
kennethkong852
Contributor II

Hello NXP Community,

I am attempting to configure my LPC54102 such that from within the PIN_INT0_IRQHandler() an I2C read from a downstream slave device will be done via DMA.  I would like to know if there's an example that can outline such setup/configuration?

Alternatively, if an exact example for the above scenario is not available, I read from the LPC5410x Ref Manual regarding using DMA with I2C Master as follows:

23.7.6.1 DMA as a Master transmitter

A basic sequence for a Master transmitter:
• Software sets up DMA to transmit a message.
• Software causes a slave address with write command to be sent and checks that the
address was acknowledged.
• Software turns on DMA mode in the I 2C.
• DMA transfers data and eventually completes the transfer.
• Software causes a stop (or repeated start) to be sent.

However, I don't see any code snippet showing the above.  Can anyone please point me to such sample code?

Much appreciated, thank you!

Ken

标签 (1)
0 项奖励
回复
2 回复数

434 次查看
Harry_Zhang
NXP Employee
NXP Employee

Hi @kennethkong852 

You're correct.

In MCUXpresso SDK for LPC54102, the following examples demonstrate partial functionality you need:

1. i2c_dma_b2b_transfer_slave

Harry_Zhang_0-1749607794585.png

This shows how to:

Configure the I2C master for DMA-based receive.

But this does not include GPIO interrupts.

2. pint_pin_interrupt

Harry_Zhang_1-1749607978071.png

This shows:

How to set up a GPIO pin interrupt using the General Purpose Interrupt.

You can combine these two examples to achieve your functionality.

BR

Harry

 

0 项奖励
回复

447 次查看
kennethkong852
Contributor II

Sorry I referenced the wrong section of UM...

This is the one I intended to include:

23.7.6.2 DMA as a Master receiver
A basic sequence for a Master receiver:
• Software sets up DMA to receive a message.
• Software causes a slave address with read command to be sent and checks that the
address was acknowledged.
• Software starts DMA.
• DMA completes.
• Software causes a stop or repeated start to be sent.

0 项奖励
回复