Hi Melanie,
In fact this is only a matter of definition of the addresses in a specific context.
If one consider the MCP23008 "as it", its address is determined by A2, A1, A0 and the higher bits which are predetermined for this specific component. At this level of the design nobody knows in which context (program, compiler, hardware) the component is going to be used and the address has to be written as : 20H + (A2,A1,A0). For example, if (A2,A1,A0) = (0,0,1) then the address is 21H. We can call it a physical address and it is only component dependant.
Now, if we want to pass this address to a PBP program, we have to shift it once left to leave some room for the R/W bit. Therefore this specific byte field value will be obtained by multiplying the physical component address by two (shift left once) and leaving the R/W to 0. At this level and for the hereabove example the field value is equal to 42H.
Formally speaking, it is not very logical to pass an already shifted physical address to the program but once this is known and clear, no problem, it works.
Best regards
MikeBZH / F8DFN


 
						
					 
			 
			 
			 
					
					 
 
		 
				
				
				
				
			

Bookmarks