1 of 1 people found this helpful
You need to change the inner connection of the pin and then control it with firmware when you stop the LCD. Please take a look at the following KBA. It tells you how to change the output of PWM when you stop it. The pin of the LCD would be similar. It also has code example which will be a good reference.
The following AN also tells how to change inner connection of the pin in chapter6.10.
You may also need to refer to the register TRM about the HSIOM register in chapter 8. The connection of each pin is controlled by a 4-bit register.
Thank you very much, I will go through the referenced documents and post here the result or any following issues.
Thank you OwenZ_26 , it worked.
My LCD is on Port2 (and it is the only thing that is on that port), so I had to switch the multiplexer and select pin "off mode":
CY_SET_REG32(CYREG_HSIOM_PORT_SEL2, ((CY_GET_REG32(CYREG_HSIOM_PORT_SEL2)) & LCD_PORT_PINS_MASK)); CY_SET_REG32(CYREG_PRT2_PC, 0x00000000);
After this I set the wake up polarity from P0.7 and enter the Stop mode.
I am still a bit curious, how does all that actually work.
1) If I understand the AN86233 correctly, the IOs should get frozen before entering the Stop mode. However, after waking up by the P0.7 interrupt (which causes a reset), Port2 is set for the LCD component (which works). Does the freezing affect only PRTx_DR registers and not the pin multiplexer etc.?
2) The pin "off mode" should be the best (regarding the lowest possible power consumption) and my question is, are the GPIOs in this state by default? (I mean the unused ones, not placed into the schematics.)
1) When it says pins, I believe it is referring to external pins. The multiplexer is internal to the chip, and thus might have different behavior?
2) Unused pins are set to high-impedance which will have the least power drain (assuming you wire them to something rather than leave them floating)