Hi Christopher,
It would be nice if you linked to the datasheet you're looking at but due to your other currently 'active' threads I suspect it's the MCP2515 we're talking about? If not then this answer may not apply.
1) There are three INEEDSLEEP registers, one at adress $80, one at $90 and one at $100. Judging by the other register names in the MCP2515 the description of the register in the datasheet would likely be something like INEEDSLEEPn where n is the number of the register. 0,1,2 or perhaps 1,2,3. There are 8bits en each register but you're interested in the lower 4bits <3:0> of each register.
2) It depends on what INEEDSLEEP does and what YOU want to do really. Since I don't know CAN or the MCP2515 (if that's what we're really talking about here) I'm going to try a stupid example. If the chip wasn't a CAN driver but a say PWM chip with three output channels. Then you'd have three dutycycle registers in the chip. The functionality and operation of the registers would be exactly equal so instead of describing it three times in the datasheet the might show it DUTYn (at adresses $10, $20, $30 or whatever) where n is either 0,1 or 2 for the three different channels.
Now, if you wanted to set the dutycycle of all three channels to 0 would you write 0 to all three registers? YES of course. If you then wanted to set the dutycycle of channel 1 to 50 would you write 50 to all three registers? NO of course not, you'd write 50 to DUTY1, which is at address $20 in the external chip. If it was in the PIC then the actual address would be of less interest because the compiler would include a file (think of it like sort of a phonebook) with register names and their addresses, so you could access it directly by its name (DUTY1).
As I said, a stupid example but it's the best I can do without reference to the actual part and actual register. I hope it makes some sense though.
/Henrik.




Bookmarks