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

I2C initialization on registers level

Hello,

I work with the ATE using Algocraft WN series programmer.

It has directly access to GPIO registers through SWD interface with WRITE / READ / COMPARE commands.

I already succeed to toggle and read states on GPIO pins.

Now I need to initialize I2C interface and work with external I2C peripheral devices.

How to initialize the I2C interface correctly?

Is there any description of the proper registers write/read sequence?

Thanks in advance.

Parents Reply
  • Hi,

    0xBFFFFFFF and 0xFFFFFF7F is not valid values in the PSELSDA/PSELSCL registers. These registers should be set to the GPIO pin number (0x7 and 0x1E in your case), of 0xFFFFFFFF in case the pin is Disconnected:

    The address register should also be set before starting the transfer.

    I verified that these commands works with nrfjprog:

    nrfjprog --memwr 0x40003500 --val 0x00000000
    nrfjprog --memwr 0x50000778 --val 0x00000302
    nrfjprog --memwr 0x5000071c --val 0x0000060C
    nrfjprog --memwr 0x40000528 --val 0x00000009
    nrfjprog --memwr 0x4000350c --val 0x1E
    nrfjprog --memwr 0x40003508 --val 0x7
    nrfjprog --memwr 0x40003524 --val 0x01980000
    nrfjprog --memwr 0x40003500 --val 0x00000005
    nrfjprog --memwr 0x40003588 --val 0x00000055
    nrfjprog --memwr 0x40003008 --val 0x00000001

    This generates the following output on the pins:

    Best regards,
    Jørgen

Children
Related