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

TWI and UART

Situation: SES, SDK 16, nRF52832, no BLE.

I'm trying to use both the UART and TWI 0. TWI works fine with BLE and all the rest. However, when I enable the UART, TWI quits working but the UART works just fine.

1) I checked instantiation - the two do not share.

2) UART and UARTE both enabled in sdk_config.h as in peripheral/uart example.

3) Using app_uart_fifo per the demo.

4) You can't compile the legacy stuff required without UARTE enabled, there's a compile time error.

Where to start?

Parents
  • Hello,

    That does sound strange. Right off the bat my suspicion is that they share a define/buffer/instance or pin, which the enabling of UART overwrites control of.
    Which pins are you using for both the UART and TWI?

    when I enable the UART, TWI quits working but the UART works just fine.

    Could you also tell me some more about the behavior you are seeing? How do you determine that the TWI has stopped working?

    1) I checked instantiation - the two do not share.

    How did you check this? I am just asking this to be sure before ruling it out.

    3) Using app_uart_fifo per the demo.

    Are you working with a modified version of the UART peripheral example, in which you have added TWI as demonstrated in the TWI Scanner example?
    If you are, please elaborate on what modifications and additions you have made to the exampe.
    Please correct me if I am wrong.
    For the record, are you implementing a TWI slave or master on your device?

    4) You can't compile the legacy stuff required without UARTE enabled, there's a compile time error.

    This is interesting. Could you elaborate on what you mean by "legacy stuff" and which compile time error you are getting?

    Looking forward to resolving this issue together,

    Best regards,
    Karl

     

Reply
  • Hello,

    That does sound strange. Right off the bat my suspicion is that they share a define/buffer/instance or pin, which the enabling of UART overwrites control of.
    Which pins are you using for both the UART and TWI?

    when I enable the UART, TWI quits working but the UART works just fine.

    Could you also tell me some more about the behavior you are seeing? How do you determine that the TWI has stopped working?

    1) I checked instantiation - the two do not share.

    How did you check this? I am just asking this to be sure before ruling it out.

    3) Using app_uart_fifo per the demo.

    Are you working with a modified version of the UART peripheral example, in which you have added TWI as demonstrated in the TWI Scanner example?
    If you are, please elaborate on what modifications and additions you have made to the exampe.
    Please correct me if I am wrong.
    For the record, are you implementing a TWI slave or master on your device?

    4) You can't compile the legacy stuff required without UARTE enabled, there's a compile time error.

    This is interesting. Could you elaborate on what you mean by "legacy stuff" and which compile time error you are getting?

    Looking forward to resolving this issue together,

    Best regards,
    Karl

     

Children
No Data
Related