Need help with 'Standard alphanumeric LCD based on I2C
Need help with 'Standard alphanumeric LCD based on I2C
Need help understanding the pin connections between the I2C device and the LCD for this component; Standard alphanumeric LCD based on a standard I2C control bus.
I have seen many times the use of the MCP23008 I/O expander for the I2C device. Two examples ares provided in the attached graphics. I want to move my prior programming to Flowcode, but need help on understanding the various components beyond what is provided online. The Flowcode 7 help file for components does not provide any of this information; http://www.matrixtsl.com/wikiv7/index.p ... 6eb62e0762
I appreciate your help. Thank you.
I have seen many times the use of the MCP23008 I/O expander for the I2C device. Two examples ares provided in the attached graphics. I want to move my prior programming to Flowcode, but need help on understanding the various components beyond what is provided online. The Flowcode 7 help file for components does not provide any of this information; http://www.matrixtsl.com/wikiv7/index.p ... 6eb62e0762
I appreciate your help. Thank you.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Need help with 'Standard alphanumeric LCD based on I2C
Hello,
Currently the only way to support the I/O expander is to use the I2C component and then manually control the various pins of the expander. Doing this to drive an LCD would be tricky.
We have a plan to allow custom pins in the future via expanders so that the expander is basically providing more generic Flowcode usable I/O that can be used with existing components e.g. the LCD.
I would go for the I2C backpack route as these are currently supported as Flowcode components.
https://www.adafruit.com/product/292
Currently the only way to support the I/O expander is to use the I2C component and then manually control the various pins of the expander. Doing this to drive an LCD would be tricky.
We have a plan to allow custom pins in the future via expanders so that the expander is basically providing more generic Flowcode usable I/O that can be used with existing components e.g. the LCD.
I would go for the I2C backpack route as these are currently supported as Flowcode components.
https://www.adafruit.com/product/292
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Need help with 'Standard alphanumeric LCD based on I2C
Thank you for the reply, Benj.
While you state the code works for the Adurino backpack, the question really remains the same as originally stated. In order for me to utilize the Flowcode component for the LCD_I2C component, what pins from the MCP23008 goes to which pins on the LCD? The original question pertains to the necessary understanding to the user of Flowcode on what port assignments (GP0 through GP7) from the I/O expander to which pins on the LCD is the component code written for? The flowcode help file does not provide this basic necessity to utilize the component. Nor can it be found on the backpack information.
I am not sure why you state "Currently the only way to support the I/O expander is to use the I2C component and then manually control the various pins of the expander. Doing this to drive an LCD would be tricky." The backpack photo you provided in your link shows a MCP23008 I/O Expander. The very thing you say is trick to control. Yet, the LCD_I2C component in Flowcode is based on this as you pointed out towards the backpack. Coding for an I/O Expander for an LCD is simple.
My decision to go with Flowcode was the ease of using the visual way to program. My main software for writing code to use the MCP23008 to the LCD provides the necessary wiring schematic to work with their component code in their software. But I cannot find the same kind of technical information through Matrix on how to wire the two components together to utilize your LCD_I2C component code. As I view the other help files on the other components, information is lacking to help the user of Flowcode. Are there plans to improve this information?
Thank you
While you state the code works for the Adurino backpack, the question really remains the same as originally stated. In order for me to utilize the Flowcode component for the LCD_I2C component, what pins from the MCP23008 goes to which pins on the LCD? The original question pertains to the necessary understanding to the user of Flowcode on what port assignments (GP0 through GP7) from the I/O expander to which pins on the LCD is the component code written for? The flowcode help file does not provide this basic necessity to utilize the component. Nor can it be found on the backpack information.
I am not sure why you state "Currently the only way to support the I/O expander is to use the I2C component and then manually control the various pins of the expander. Doing this to drive an LCD would be tricky." The backpack photo you provided in your link shows a MCP23008 I/O Expander. The very thing you say is trick to control. Yet, the LCD_I2C component in Flowcode is based on this as you pointed out towards the backpack. Coding for an I/O Expander for an LCD is simple.
My decision to go with Flowcode was the ease of using the visual way to program. My main software for writing code to use the MCP23008 to the LCD provides the necessary wiring schematic to work with their component code in their software. But I cannot find the same kind of technical information through Matrix on how to wire the two components together to utilize your LCD_I2C component code. As I view the other help files on the other components, information is lacking to help the user of Flowcode. Are there plans to improve this information?
Thank you
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Need help with 'Standard alphanumeric LCD based on I2C
Hello,
I didn't realise the I2C backpacks used those chips
There is a schematic for the backpack wiring here.
https://learn.adafruit.com/assets/35681
Once you have the LCD wired to the backpack you simply connect the two I2C pins SDA and SCL to the microcontroller and control via Flowcode.
I didn't realise the I2C backpacks used those chips

There is a schematic for the backpack wiring here.
https://learn.adafruit.com/assets/35681
Once you have the LCD wired to the backpack you simply connect the two I2C pins SDA and SCL to the microcontroller and control via Flowcode.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Need help with 'Standard alphanumeric LCD based on I2C
Benj, I am still working to get the MCP23008 to the LCD working using the LCD_I2C component using the schematic you provided. Please help me to understand two things.
First, is the proper programing order to execute the I2C_Master initialize command and then use the LCD_I2C start command.
Second, and this may be mute if the steps above are not correct, is whether the LCD_I2C start command writes default values to the MCP23008 registers so that it can be used to send the proper information to the LCD. With no initialization step in the LCD_I2C commands, I can only think the initialization of the MCP23008 is through the start command.
Thank you
First, is the proper programing order to execute the I2C_Master initialize command and then use the LCD_I2C start command.
Second, and this may be mute if the steps above are not correct, is whether the LCD_I2C start command writes default values to the MCP23008 registers so that it can be used to send the proper information to the LCD. With no initialization step in the LCD_I2C commands, I can only think the initialization of the MCP23008 is through the start command.
Thank you
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Need help with 'Standard alphanumeric LCD based on I2C
Hello,
Can you send us your program and we will have a look for you. The LCD_I2C Start macro is all you should have to send to get the LCD ready to display data.
Can you send us your program and we will have a look for you. The LCD_I2C Start macro is all you should have to send to get the LCD ready to display data.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Need help with 'Standard alphanumeric LCD based on I2C
Benj,
Attached is the program to test the LCD_I2C. I followed the circuitry schematic you provided earlier, which is the backpack by Adafruit.
Thank you for your help.
Gary
Attached is the program to test the LCD_I2C. I followed the circuitry schematic you provided earlier, which is the backpack by Adafruit.
Thank you for your help.
Gary
- Attachments
-
- LCD_Demo_4_BIT.fcfx
- (9.72 KiB) Downloaded 335 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Need help with 'Standard alphanumeric LCD based on I2C
Hi Gary,
You don't need the I2C Master component in your program, just the display component should be enough. Saying this I don't think this should be an issue.
What are your address pins on the MCP23008 set to, are they all connected to ground? If so then the current address value of 32 should be correct.
Have you tried a 1 second flasher to confirm the micro is actually running and at the correct speed?
https://www.matrixtsl.com/wikiv7/index. ... ED_flasher
I've made a few minor changes for you.
You don't need the I2C Master component in your program, just the display component should be enough. Saying this I don't think this should be an issue.
What are your address pins on the MCP23008 set to, are they all connected to ground? If so then the current address value of 32 should be correct.
Have you tried a 1 second flasher to confirm the micro is actually running and at the correct speed?
https://www.matrixtsl.com/wikiv7/index. ... ED_flasher
I've made a few minor changes for you.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: Need help with 'Standard alphanumeric LCD based on I2C
Benj,
Yes, the address pins are grounded.
The PIC is on my breadboard. To date, the program I have written with FC6 utilizes the USB and RS232 successfully. I have also successfully written FC6 code to write correctly to the LCD using the MCP23008 with the wiring for the Adafruit backpack. I wrote this code as I was unable to get the LCD_I2C code to work. Today, I placed the oscilloscope probes on the SDA/SCL lines to understand what it being sent to the MCP23008 from the LCD_I2C component Start command. It is sending 4 sets of bytes to the device. With my scope, I can only determine the first two sets clearly. The first set is $40 and $3C. The second set is $40 and $38. The $40 is the correct device write address. The next byte following the address does not make sense as it should be the register address. The MCP23008 has register addresses ranging from $00 to $0A. I expected to see a set of commands to configure the MCP23008 for the GPIO to be outputs and to set the IOCON register to disable non-sequential operations. All future commands to the MCP23008 would then have to be to set the register to the OLAT ($0A) and then continually write the bytes to it which want to be sent to the LCD module. It seems the LCD_I2C component needs an initialization routine within its coding for this to work.
Thank you.
Yes, the address pins are grounded.
The PIC is on my breadboard. To date, the program I have written with FC6 utilizes the USB and RS232 successfully. I have also successfully written FC6 code to write correctly to the LCD using the MCP23008 with the wiring for the Adafruit backpack. I wrote this code as I was unable to get the LCD_I2C code to work. Today, I placed the oscilloscope probes on the SDA/SCL lines to understand what it being sent to the MCP23008 from the LCD_I2C component Start command. It is sending 4 sets of bytes to the device. With my scope, I can only determine the first two sets clearly. The first set is $40 and $3C. The second set is $40 and $38. The $40 is the correct device write address. The next byte following the address does not make sense as it should be the register address. The MCP23008 has register addresses ranging from $00 to $0A. I expected to see a set of commands to configure the MCP23008 for the GPIO to be outputs and to set the IOCON register to disable non-sequential operations. All future commands to the MCP23008 would then have to be to set the register to the OLAT ($0A) and then continually write the bytes to it which want to be sent to the LCD module. It seems the LCD_I2C component needs an initialization routine within its coding for this to work.
Thank you.