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

Pin re-mapping

Hi

I'm going to use a module that uses nRF51422 and that has an adapter to be soldered as a SMD in a circuit to mimic the footprint of an AP2 module. The adapter only has 17 pins, so the vendor has mapped the I/O pins at will and I find myself with the need to write to a whole port in the 422 using nrf_gpio_port_write. The problem is that even though there are enough pins left to map a port, the mapping never uses more than 2 consecutive pins. The mapped pins are P000, 002, 003, 005, 006, 008, 009, 011, 012, 015, 024, 030 and 031.

I remember from a Nordic workshop I attended that someone stated that it was possible to rewire the digital I/O pins internally so, for example P000 was connected to pin 12. Is that true? how can that be achieved? I haven't found anything in the docs I've reviewed or in the forums (apart from a mention to "pin crossbar", that apparently is only used to change the pins used by the UART). This is the only way I see to group the 8 pins I need for a port and map them to the actual physical connections in the socket adapter.

Any help will be highly appreciated.

Thanks!

Parents
  • I believe you may have misunderstood the person at that workshop; the PPI allows you to route task endpoints to the GPIO of your choice but still, memory mapped GPIO P0.00 is on pin 4 of the QFAB part. Looking at Figure 16 of the nRF51 Series Reference Manual I don't see anything before OUT.0 which is what I think you were hoping for.

    Faced with your situation I would write a function named nestor_gpio_port_write() that performed all of the messy bit manipulation and eventually called nrf_gpio_port_write() to get things done.

    Dan

  • This is absolutely correct; you can't renumber the GPIO pins, and the person you talked to on the workshop probably meant the fact that digital, serial interfaces of the chip are re-mappable to any pin on the chip (i.e. any pin can be used for UART, SPI, TWI). Working around this by wrapping it in a custom function is a good suggestion!

Reply Children
No Data
Related