nucleo 32-l432kc with mcp23018 Problème IODIR
Posted: Fri Dec 03, 2021 5:21 pm
hello everybody 
I am new user, i hope i am in the good section !
1st - sorry im french so i use google translate to try to explain my problem ..
2nd - ENVIRONMENT
/nucleo 32-l432kc
/IDE ARDUINO
/Wire.h
/all Register 0x00
/ADDRS : mcp1 0x20
/ADDRS : mcp2 0x21
/ADDRS : GPOIA 0X12
/ADDRS : GPIOB 0X13
3rd - Project
my new project is to order a mcp23018 with the nucleo 32, to order on each output pin (16i / o).
i use only the Wire Library, and i configure the register himself.
the connection is well established and I have checked the state of my register as well as their state, everything is functional.
I also manage to drive each output one by one on each port A or B of the mcp23018 (OPEN-DRAIN) to start the leds initially.
My Problem is related to the IODIR register, which configures the pins in input or output.
I put 0x00 for output in IODIR but at power-up all the outputs are activated, which causes me a problem.
When I program all the outputs to 0000 000 (open-drain) this activates the outputs, my leds light up no problem, but if I program them to 1111 1111 (off), when the power is turned on it creates a small flash because at rest or without default command the pins are activated.
if I comment out the IODIR register that removes the problem for me but my pins go into input ...
I think that there must be in the other registers a configuration to make to remove the problem but I block above.
The mcp is ultimately quite complex I found on the datasheet, a lot of configurable register and I may get lost in it
Someone have already programmed this mcp23018 on nucleo under IDE ARDUINO?
Thanks for reading me
http://ww1.microchip.com/downloads/en/d ... 22103a.pdf FOR MCP23018

I am new user, i hope i am in the good section !
1st - sorry im french so i use google translate to try to explain my problem ..

2nd - ENVIRONMENT
/nucleo 32-l432kc
/IDE ARDUINO
/Wire.h
/all Register 0x00
/ADDRS : mcp1 0x20
/ADDRS : mcp2 0x21
/ADDRS : GPOIA 0X12
/ADDRS : GPIOB 0X13
3rd - Project
my new project is to order a mcp23018 with the nucleo 32, to order on each output pin (16i / o).
i use only the Wire Library, and i configure the register himself.
the connection is well established and I have checked the state of my register as well as their state, everything is functional.
I also manage to drive each output one by one on each port A or B of the mcp23018 (OPEN-DRAIN) to start the leds initially.
My Problem is related to the IODIR register, which configures the pins in input or output.
I put 0x00 for output in IODIR but at power-up all the outputs are activated, which causes me a problem.
When I program all the outputs to 0000 000 (open-drain) this activates the outputs, my leds light up no problem, but if I program them to 1111 1111 (off), when the power is turned on it creates a small flash because at rest or without default command the pins are activated.
if I comment out the IODIR register that removes the problem for me but my pins go into input ...

I think that there must be in the other registers a configuration to make to remove the problem but I block above.
The mcp is ultimately quite complex I found on the datasheet, a lot of configurable register and I may get lost in it

Someone have already programmed this mcp23018 on nucleo under IDE ARDUINO?
Thanks for reading me


http://ww1.microchip.com/downloads/en/d ... 22103a.pdf FOR MCP23018