This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Communication priority

Hi

I am currently developing using GPIOTE, TWI, and TIMER.

There is no problem when TWI is only working, but when interrupt (GPIOTE, TIMER simultaneously) occurs, TWI stops.

I don't know why this is happening.

Please help me.

Thank you.

  • Hi

    Thank you for reply.

    I didn't touch twi priority, also I didn't use ble.

    There's something I didn't say by mistake.

    I need to receive sensor data in real time for 20 seconds using twi.

    I have run 2 tests.

    1. The first is to perform LCD update and twi communication in the main at the same time.
    2. The second method is to perform twi communication only in the main, and update the LCD when an interrupt occurs in GPIOTE.

    In the first test, the twi was not cut off, but it was confirmed that the value came in slowly. And then we had a problem that went over 20 seconds.

    In the second test, the value comes in real time, but when GPIOTE Interrupt occurs, sensor data stops coming in briefly or twi communication and lcd stop at the same time.

      

    test 1 result                      test 2 result

                                            (The red line is when the gpiote interrpt occurred and the lcd was updated.)

    Thank you.

  • Hello again,

    Minseo said:

    There's something I didn't say by mistake.

    I need to receive sensor data in real time for 20 seconds using twi.

    Thank you for clarifying - this is good for me to know.
    How much is being transferred each second? And when you say that you need data in real-time, what is the timing requirement?

    Minseo said:
    In the first test, the twi was not cut off, but it was confirmed that the value came in slowly. And then we had a problem that went over 20 seconds.

    Could you be more explicit? What do you mean that the value came in slowly - did the frequency of the TWI RX events slow down? Or did you just notice that the timestamp of the logging suddenly had longer gaps? If so, how and where are the timestamps captured/generated?

    Minseo said:
    but when GPIOTE Interrupt occurs, sensor data stops coming in briefly or twi communication and lcd stop at the same time.

    Do you have access to a logical anaylzer? It would be a lot easier to pinpoint this behavior with certainty if we could scope the RX/TX lines and see what is actually happening on them.
    The pictures you have included here, is this just a logger output you have set to write out the time of the log writing, and the received sensor value?
    Are you using the nrf logger module for this? If so, are you using the deferred logging option of the logger? Please check what your NRF_LOG_DEFERRED define in the sdk_config.
    I suspect that the data is coming in as it should - since you are using easyDMA, and the processor thus dont have to be involved in each received transfer for it to succeed - but that the logging is deferred until the processor is idle. 

    Looking forward to resolving this issue together!

    Best regards,
    Karl

Related