Clarification on ULP co-processor REG_RD instruction

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Clarification on ULP co-processor REG_RD instruction

Postby kolban » Thu Nov 23, 2017 3:41 am

Am studying the REG_RD instruction in the documentation found here:

http://esp-idf.readthedocs.io/en/latest ... l-register

In there, there is an example:

Code: Select all

REG_RD      0x120, 2, 0     // load 4 bits: R0 = {12'b0, REG[0x120][7:4]}
My puzzle is, that I am not seeing the match between the example instruction and its comment. To me,

Code: Select all

REG_RD 0x120, 2, 0
Should result in:

Code: Select all

R0 = REG[0x120][2:0]
or in other words, the ULP Co-processor register called R0 will be loaded with the 3 bits (bit 2, bit 1, bit 0) from the 32 bit word found at word index 0x120 from the base of the RTC peripheral memory. Compared to the example, we are loading 3 bits and not 4 and the positions of the bits are distinct. Might this be a typo in the example or ... and hence the question ... a failure on my part to understand a concept?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Clarification on ULP co-processor REG_RD instruction

Postby ESP_igrr » Thu Nov 23, 2017 4:28 am

Looks like a typo or the case when comments get out of sync.

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 98 guests