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

twi_scanner example only returning address 0x01

I have set up a custom board using the nRF52811 based BMD-360 module.

I have tested the twi_scanner example, first of the nrf52DK with an external sensor. I Changed the TWI pins to the ones I am using on the custom board (SCL: 26, SDA: 25) and verified it worked as expected returning the address of the sensor over UART.

I have set up a custom board using the nRF52811 based BMD-360 module, and modified the project to target the nrf52811 (extracted settings from a PCA10056e project and changed the target, etc.). The program compiles fine and runs. My custom board doesn't have a serial output, so I have placed breakpoints to check for any detected devices. 

I only seem to be detecting one device on address 0x01, regardless of if I have a sensor attached to the board or not. I have tried the same sensor as I used with the DK connected, and still get the same result.

I have pull-ups on the TWI lines and nothing else on the bus so I don't think it's a hardware issue. I think it may just be a configuration problem moving from the nRF52840 DK to the nRF52811?

Any help would be appreciated.

(Using nRF5 SDK16.0.0)

Parents
  • Hi,

    First, you can make sure you have followed all the steps in the "Transferring the project to nRF52811 hardware" guide on the infocenter.

    Could it be that you are using the wrong pins? You can double check which pins you are using looking at the TWI register. Check the PSEL.SCL and PSEL.SDA pin registers:

    If you have a logic analyzer or oscilloscope at hand you can also look at the traces to see how the signal looks like.

    Best regards,

    Marjeris

  • Thanks for your reply Margeris.

    My preprocessor defines

    BOARD_PCA10056
    BSP_DEFINES_ONLY
    CONFIG_GPIO_AS_PINRESET
    FLOAT_ABI_SOFT
    INITIALIZE_USER_SECTIONS
    NO_VTOR_CONFIG
    NRF52811_XXAA

    Linker:

    FLASH_PH_START=0x0 
    FLASH_PH_SIZE=0x30000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x6000
    FLASH_START=0x0
    FLASH_SIZE=0x30000
    RAM_START=0x20000000
    RAM_SIZE=0x6000

    Other setup:

    For the record, that guide does not cover everything necessary and in enough detail. It took me hours to figure out how to transfer the project before using a PCA100056e example. It doesn't mention the soft FPU change required in SES's Code generation section/preprocessor define at all, and the linker script settings are exceptionally confusing when all the IDEs use different approaches. To save others time and frustration I think it's really worth updating.

    Registers:

    I'll hopefully get a chance to check on a scope later today.

Reply
  • Thanks for your reply Margeris.

    My preprocessor defines

    BOARD_PCA10056
    BSP_DEFINES_ONLY
    CONFIG_GPIO_AS_PINRESET
    FLOAT_ABI_SOFT
    INITIALIZE_USER_SECTIONS
    NO_VTOR_CONFIG
    NRF52811_XXAA

    Linker:

    FLASH_PH_START=0x0 
    FLASH_PH_SIZE=0x30000
    RAM_PH_START=0x20000000
    RAM_PH_SIZE=0x6000
    FLASH_START=0x0
    FLASH_SIZE=0x30000
    RAM_START=0x20000000
    RAM_SIZE=0x6000

    Other setup:

    For the record, that guide does not cover everything necessary and in enough detail. It took me hours to figure out how to transfer the project before using a PCA100056e example. It doesn't mention the soft FPU change required in SES's Code generation section/preprocessor define at all, and the linker script settings are exceptionally confusing when all the IDEs use different approaches. To save others time and frustration I think it's really worth updating.

    Registers:

    I'll hopefully get a chance to check on a scope later today.

Children
Related