PSoC 4 Character LCD component

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaKo_463136
Level 5
Level 5
10 likes received 10 likes given 5 likes given

Hello,

I am using a PSoC 4 Character LCD component to display some characters on a 16x2 LCD.

My design is low power, so I am powering the whole LCD from one of the PSoC pins and shut down the power when not needed.

However, I suspect there is a current leak on a control and/or data pins from the LCD port during the time the Vdd to LCD is cut off.

What is the best way to switch all the control and data pins (on PSoC side) of the LCD port to active low or high impedance mode?

The pins are tied to the component so I guess I can't define them one more time in the main.c

Thank you,

David

0 Likes
1 Solution
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

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.

https://community.cypress.com/docs/DOC-10494

The following AN also tells how to change inner connection of the pin in chapter6.10.

http://www.cypress.com/documentation/application-notes/an86439-psoc-4-using-gpio-pins

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.

http://www.cypress.com/documentation/technical-reference-manuals/psoc-4000s-family-psocr-4-registers...

Regards,

Owen

View solution in original post

4 Replies
Owen_Zhang123
Moderator
Moderator
Moderator
5 questions asked 500 solutions authored 250 sign-ins

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.

https://community.cypress.com/docs/DOC-10494

The following AN also tells how to change inner connection of the pin in chapter6.10.

http://www.cypress.com/documentation/application-notes/an86439-psoc-4-using-gpio-pins

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.

http://www.cypress.com/documentation/technical-reference-manuals/psoc-4000s-family-psocr-4-registers...

Regards,

Owen

Thank you very much, I will go through the referenced documents and post here the result or any following issues.

David

0 Likes

Thank you zhxh​ , 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.)

Thank you,

David

0 Likes
Anonymous
Not applicable

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)