Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Regarding MCP-23017-E interfacing with dsPIC30F4011 using I2C protocol

Status
Not open for further replies.

htcompany

Junior Member level 2
Joined
Feb 2, 2016
Messages
22
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
220
Hello to all,
I am interfacing IO expander ic MCP-23017 with dsPIC30F4011 Controller using I2C protocol. while writing code in c for that, there are more than one IOCON.BANK to be selected. I don't know how to select that register, bcoz all IOCON.BANK have same register configuration values. Please kindly suggest me if anybody has an idea about this......



Regards,
htcompany
 

Hi,

it just selects the order (of the address) of the registers.
* with IOCON.BANK = 1: Addr 0x00 to 0x0A are for channel A, while Addr 0x10 to 0x1A are for channel B (address bit 4 selects channel A or B)
* with IOCON.BANK = 0: the channels are alternating: A, B, A, B ... (address bit 0 selects channel A or B)

That´s all.
--> Select the register order you find the most convenient for your code.

Klaus
 

QUESTION :

Hello,
But sir the point is, how to select the bank from IOCON.BANK = 1 and IOCON.BANK = 0 in program? how does dsPIC30F controller come to know about specific IOCON.BANK ? the thing you just mentioned in above thread, i already about it. the problem is the choosing of specific IOCON.BANK in code.......kindly suggest solution please....


Regards,
htcompany
 

Hi,

After power_up and after RESET: BANK = 0.
Therefore IOCON has address 0x0A / 0x0B.

Follow the rules of section 1.6.6 when changing BANK.

Klaus
 

Question :

Hello,
In section 1.6.6, it is mentioned all the steps, but how would controller know about BANK? if i simply write BANK = 1; in MPLab, is it going to work in that way? how would controller detect that BANK register?



Regards,
htcompany
 

Hi,

it is almost standard I2C protocol: Device_address, Register_address, Data.
---> datasheet Fig. 1-1, Fig. 1-4.

Repeatedly I recommended to read the datasheet. The complete datasheet.
It makes no sense, that I read the datasheet for you and post each information here...

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top