nRF5340DK Devicetree File

Dear, I am new to Nordic. I trying to understand the various Defines for nRF5340DK kit using Devicetree.dts file. In that, I had look on SW0 defines.

1. The gpio0 reg is defined at addres at 0x842500, but what is 0x300 ? 

2. Similarly, where led0 etc and buton0 etc are defined. gpios = < &gpio0 0x1c 0x1 >; is written. What is 0xic and 0x1 in this ?,

    For button0, gpios = < &gpio0 0x17 0x11 >; what is 0x17 and 0x11 ? 

Parents Reply Children
  • Hey again Gulzar!

    I must have missed that question, sorry about that.

    gpios = < &gpio0 0x1c 0x1 >;

    You can see here that the third number refers to if it is active low or active high. It's boolean, but happens to be converted to hex here.

    mexco said:
     button0, gpios = < &gpio0 0x17 0x11 >;

    This was an interesting case, and is due to the (GPIO_PULL_UP | GPIO_ACTIVE_LOW)  line in the dts file. You can see in zephyr/include/dt-bindings/gpio/gpio.h that

    #define GPIO_ACTIVE_LOW (1 << 0) //00001
    #define GPIO_PULL_UP (1 << 4) //10000

    and 10000 | 00001 = 0b10001 = 0x11.

    Best regards,

    Elfving

  • Dear Elfving, thanks.. I have few more reated queries: 1. does gpios = < &gpio0 0x1c 0x1 >; force the pin Low after power on ?  this pin is used to drive LED. 

    2. Is the nRF5340 on nRF5340DK run on 5 volt supply or  3 Volt

    3. Are the port pins, UART pins, I2C Pins 5 Volt compatible or Level converter is required to connect with 5 volt devices ? 

  • mexco said:
    1. does gpios = < &gpio0 0x1c 0x1 >; force the pin Low after power on ?

    I dont think so, though could you expand a bit on it being used to drive an LED? Is it an output pin for the LED?

    mexco said:
    2. Is the nRF5340 on nRF5340DK run on 5 volt supply or  3 Volt

    The supply voltage range can be found in the product specification. For the nRF5340 that is 1.7 V to 5.5 V. That is however only enough for the nRF SoC itself. If you only want to run the nRF on the DK you can connect that voltage to the VDD line. For the programmer chip as well you need 5V.

    mexco said:
    3. Are the port pins, UART pins, I2C Pins 5 Volt compatible or Level converter is required to connect with 5 volt devices ? 

    The GPIO output voltage should be the same as the VDD voltage, so if you'd want 5V you would need a level converter. 

    Best regards,

    Elfving

Related