LCD 2x16 I2C backlight
Moderator: Benj
LCD 2x16 I2C backlight
Hello
I wrote simple program to control backlight on LCD 2X16 I2C. In simulation everything works fine, but in real life not. Backlight is always on. Using arduino nano, push button connected on D2 pin, lcd using i2c in pins C4 and C5.
I wrote simple program to control backlight on LCD 2X16 I2C. In simulation everything works fine, but in real life not. Backlight is always on. Using arduino nano, push button connected on D2 pin, lcd using i2c in pins C4 and C5.
- Attachments
-
- Test backligt.fcfx
- (8.5 KiB) Downloaded 259 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: LCD 2x16 I2C backlight
Hi, ule.
To control the backlight, you will need to right-click on your LCD and select Properties.
Change Use Backlight from No to Yes.
The jumper needs to stay in place for the light to be controlled.
The state of the backlight will be remembered.
With that in mind, if you turn the backlight off, then at a later date when the LCD is repowered, the backlight will remain off.
To control the backlight, you will need to right-click on your LCD and select Properties.
Change Use Backlight from No to Yes.
The jumper needs to stay in place for the light to be controlled.
The state of the backlight will be remembered.
With that in mind, if you turn the backlight off, then at a later date when the LCD is repowered, the backlight will remain off.
Martin
-
- Valued Contributor
- Posts: 779
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 186 times
- Been thanked: 204 times
Re: LCD 2x16 I2C backlight
Hi
That may have been a "typo".
I was under the impression the I2C LCD wasn't supported until FCv7 but could easily be quite wrong as I don't have any FC on this machine to check and it's been a few years.... I think then backlight control was an option under Component Macro not Properties, being used as per Viktor's link.
In FCv8 I think the backlight is as Martin describes.
I might be typing nonsense of course as I can't check
Regards
That may have been a "typo".
I was under the impression the I2C LCD wasn't supported until FCv7 but could easily be quite wrong as I don't have any FC on this machine to check and it's been a few years.... I think then backlight control was an option under Component Macro not Properties, being used as per Viktor's link.
In FCv8 I think the backlight is as Martin describes.
I might be typing nonsense of course as I can't check
Regards
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: LCD 2x16 I2C backlight
Hi,
IC2 LCD is supported in v6.
It looks like the enable backlight within properties is not present in V6.
However, it's not required as there is a backlight on/off function.
I have tested the attached project with my I2C LCD and it is flashing the backlight every second.
I have changed the original project to eliminate switch issues
IC2 LCD is supported in v6.
It looks like the enable backlight within properties is not present in V6.
However, it's not required as there is a backlight on/off function.
I have tested the attached project with my I2C LCD and it is flashing the backlight every second.
I have changed the original project to eliminate switch issues
- Attachments
-
- Test backlight basic.fcfx
- (7.88 KiB) Downloaded 252 times
Martin
-
- Posts: 354
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 62 times
- Contact:
Re: LCD 2x16 I2C backlight
Hello
I have a question
Does the BacklightControl macro control the state of on-board of i2c module transistor?
Is it possible to show this macro?
Thanks
I have a question
Does the BacklightControl macro control the state of on-board of i2c module transistor?
Is it possible to show this macro?
Thanks
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: LCD 2x16 I2C backlight
hello.
Yes, I believe it does.
It looks like the module's transistor is biased on via a base bias resistor.
One of the outputs from the PCF8574 pulls the base of the transistor low, to turn the backlight off.
Yes, I believe it does.
It looks like the module's transistor is biased on via a base bias resistor.
One of the outputs from the PCF8574 pulls the base of the transistor low, to turn the backlight off.
Martin
Re: LCD 2x16 I2C backlight
Schematic of i2c backpack interface is something like this. I also tried different versions to turn it off via i2c, but with no success. It does blink, like @medelec35 wrote, otherwise it remain on.
- Attachments
-
- PCF8574-I2C-Backpack-Module-for-LCD-1.png (109.38 KiB) Viewed 40597 times
-
- Valued Contributor
- Posts: 779
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 186 times
- Been thanked: 204 times
Re: LCD 2x16 I2C backlight
Hi
Back in front of my machine.
I could not find any I2C Display in v6 and seem to have found a "hidden feature" of FC which I'm glad to say is no longer. In Global Options you need to check a box to see everything in a category.....
Quite why this was the case is beyond me but no doubt a reason at the time. I can only hope I had that ticked when I used v6 or I might have upgraded to v7 needlessly (v6 only on this machine for historical reasons).
From the schematic it looks like with jumper inserted it would be on permanently until the pin went Low. Have you tried sending "0" using the component macro as per Medelec's chart? That should switch it off permanently or until a "1" is sent.
Regards
Back in front of my machine.
I could not find any I2C Display in v6 and seem to have found a "hidden feature" of FC which I'm glad to say is no longer. In Global Options you need to check a box to see everything in a category.....
Quite why this was the case is beyond me but no doubt a reason at the time. I can only hope I had that ticked when I used v6 or I might have upgraded to v7 needlessly (v6 only on this machine for historical reasons).
From the schematic it looks like with jumper inserted it would be on permanently until the pin went Low. Have you tried sending "0" using the component macro as per Medelec's chart? That should switch it off permanently or until a "1" is sent.
Regards
Re: LCD 2x16 I2C backlight
Medelec35 chart does only blinking (1s-on/1s-off). I use this before for warnings, but in normal condition the lcd backlight was on. Now I want to backlight stay off until the button is pressed. I posted flowchart with this function in first post, but it only work in simulation mode.
-
- Valued Contributor
- Posts: 779
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 186 times
- Been thanked: 204 times
Re: LCD 2x16 I2C backlight
Hi
I might have an I2C kicking around to try, but if your hardware is blinking using Medelec's chart with the jumper inserted, then your hardware setup is fine, you would just need to modify to your needs.
If I find the display I'll see what happens for me with the codes posted.
Regards
I might have an I2C kicking around to try, but if your hardware is blinking using Medelec's chart with the jumper inserted, then your hardware setup is fine, you would just need to modify to your needs.
If I find the display I'll see what happens for me with the codes posted.
Regards
-
- Posts: 354
- Joined: Fri Jan 26, 2018 12:30 pm
- Location: South Australia
- Has thanked: 44 times
- Been thanked: 62 times
- Contact:
Re: LCD 2x16 I2C backlight
Hello
Please have a look at the attached file.
I am not sure if that what you are after.
Please have a look at the attached file.
I am not sure if that what you are after.
- Attachments
-
- Test backlight_4.fcfx
- (12.91 KiB) Downloaded 271 times
-
- Valued Contributor
- Posts: 779
- Joined: Fri Jun 06, 2014 3:53 pm
- Has thanked: 186 times
- Been thanked: 204 times
Re: LCD 2x16 I2C backlight
Hi Viktor
Works for me in Sim and I'm sure if implemented in HW it will work there too.
Regards
Works for me in Sim and I'm sure if implemented in HW it will work there too.
Regards
Re: LCD 2x16 I2C backlight
Well, if I put viktor_au last sample code into my project it does not working as is should. I wrote some other sample code (i think is better, because it does not affects on whole flowchart, because of delay function). Attached code is working in simulation mode and on hardware. But.... I figured out, if i put any kind command via i2c to lcd, the display will put the backlight on and will remain on (only if I test on hardware, in simulators works fine).
- Attachments
-
- Test backlight_4(1).fcfx
- (7.71 KiB) Downloaded 251 times
Re: LCD 2x16 I2C backlight
I used different approach. I cut the trace on pcb of i2c backpack, between the PCF8574 and transistor. Remove pull up resistor from base of transistor. On my pcb i added pull down resistor to D6 on arduino and connected wire to base of transistor. Everything working as i want.
- Attachments
-
- Test backligt.fcfx
- (7.13 KiB) Downloaded 243 times
-
- backpack.png (1.52 MiB) Viewed 40403 times