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

Explanation on peripheral shared resources

I don't know why I didn't notice this blurb in the reference manual sooner. In pretty much all peripheral sections (such as SPI), you have this warning:

Therefore, the user must disable all peripherals that have the same ID as the SPI before the SPI can be configured and used

I read this as: Timer0 must be disabled before SPI0 can be configured AND used. So I cannot USE the SPI0 at the same time I am using TIMER0?? Or does it only mean that TIMER0 must be disabled temporarily when I configure SPI0? Suppose the latter is the case. SD blocks TIMER0, so I cannot use ANY peripheral that ends in 0: SPI0, TWI0, UART0, RTC0 (and what about SWI0)?

Suppose I am using SPIS1 AND SD. That means I can't use ANY peripheral that ends in either 0 or 1. The only thing I can use is TIMER2!?

This can't possibly be right. Can I please get a clarification?

  • The ID is not the digit ending the peripheral name, that's the instance. The ID is the ID of the peripheral in the system (one ID equals one base address equals one set of registers so you can't use more than one peripheral sharing the same ID at the same time).

    You didn't say whether you were using nRF51 or nRF52. For nRF51 see Table 5.2 and for nRF52 see Table 8.4 for the list of peripherals and IDs. As you can see only a few peripherals really share IDs and those tend to make sense, ie SPIM0/SPIS0 on the nRF52 and SPI0/TWI0 on the nRF51

  • Thank you. I see the explanation in nRF51 reference manual, section 10.1.1 Peripheral ID now. Would be a good idea to put a link to that section from the above blurb in every peripheral chapter. Just a suggestion.

Related