This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

TASKS, EVENTS and REGISTERS

Hi,

I am writing a code base on the reference manual of nRF51422. In section 29, UART, I don't understand the differences between TASKS, EVENTS and REGISTERS. Aren't they all registers? If yes why they are not explained after this declaration, if no why they have offset value (therefor register address). There also some bits in REGISTERS with the same name to some of TASKS and EVENTS.

I saw in the libraries provided with SDK that they are defined all together (in an structure) with respect to their offset values. So it is likely that they all are registers. It is getting complicated. Can any one explain it to me?

Parents
  • All TASKS,EVENTS and REGISTERS are registers inside the chip have register addresses. They are grouped differently because of their behaviour.

    TASKS: Writing to a TASK register does some job like start the module or stop the module. One task does only one job as the name next to it suggests.

    EVENTS: These are like status registers, but only for one single status information as the name next to it suggests. If this register reads 1, then that particular event has occured. You can clear the event by writing 0 to it.

    We have such registers so that we do not have to do bit masking to trigger/stop most frequent jobs. Also this are helpful to read status and clear them by a single instruction. Registers like this are important to meet the real time constraints of the BLE softdevice where every instruction count.

  • Tim.D Sorry for confusing text. Like butch mentioned, I meant that triggering a TASK and reading an EVENT status can now be done atomically since there are dedicated registers for those. Otherwise if lot of events and tasks bits are squeezed into one register, then you need to do masking and/or bit shifting before you can trigger/read TASKS/EVENTS. Do you agree?

    I would have updated my answer with less confusing text but then these comments would become confusing, so i am leaving the text unchanged.

Reply
  • Tim.D Sorry for confusing text. Like butch mentioned, I meant that triggering a TASK and reading an EVENT status can now be done atomically since there are dedicated registers for those. Otherwise if lot of events and tasks bits are squeezed into one register, then you need to do masking and/or bit shifting before you can trigger/read TASKS/EVENTS. Do you agree?

    I would have updated my answer with less confusing text but then these comments would become confusing, so i am leaving the text unchanged.

Children
No Data
Related