Customized characters on the LCD
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Customized characters on the LCD
Hi! I read the article http://www.matrixmultimedia.com/mmforum ... &sk=t&sd=a , but I do not know how to program the other characters in the LCD. For example, I have the codes of needed characters here http://www.atariarchives.org/cgp/Ch02_Sec04.php or here http://www.compel.ru/pdf/WINSTAR/WH1602A-YGB-CP.pdf (page 13) . How are they programmed in LCD 1602 in Flow code? For example, how to program the character with the code: Lower 4 bit: LHLH, Upper 4 bit: HLHL ?
Respectfully, Alexander
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
I was not able to program an example from the article http://www.matrixmultimedia.com/mmforum ... &sk=t&sd=a in CHIP 16F887
File name: F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c
Generated by: Flowcode v3.5.8.50
Date: Thursday, October 22, 2009 10:25:06
Licence: Demo
*** DEMO VERSION ***
NOT FOR COMMERCIAL USE
http://www.matrixmultimedia.com
Launching the compiler ...
E: \ Program Files \ Matrix Multimedia \ Flowcode V3 \ BoostC \ boostc.pic16.flowcode.exe-v-t PIC16F887 "bar graph 16F887.c"
BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright (C) 2004-2007 Pavel Baranov
Copyright (C) 2004-2007 David Hobday
Licensed to FlowCode User under Single user Pro License for 1 node (s)
Limitations: PIC12, PIC16 max code size: Unlimited, max RAM banks: Unlimited
bar graph 16F887.c
Starting preprocessor: "E: \ Program Files \ Matrix Multimedia \ Flowcode V3 \ BoostC \ pp.exe" "F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c"-i "E: \ Program Files \ Matrix Multimedia \ Flowcode V3 \ BoostC \ include "-d _PIC16F887-la-c2-o" bar graph 16F887.pp "-v-d _BOOSTC-d _PIC16
...............................
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (366:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (366:2): error: failed to generate expression
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (367:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (367:2): error: failed to generate expression
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (368:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (368:2): error: failed to generate expression
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (369:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (369:2): error: failed to generate expression
bar graph 16F887.c success
failure
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
FINISHED
File name: F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c
Generated by: Flowcode v3.5.8.50
Date: Thursday, October 22, 2009 10:25:06
Licence: Demo
*** DEMO VERSION ***
NOT FOR COMMERCIAL USE
http://www.matrixmultimedia.com
Launching the compiler ...
E: \ Program Files \ Matrix Multimedia \ Flowcode V3 \ BoostC \ boostc.pic16.flowcode.exe-v-t PIC16F887 "bar graph 16F887.c"
BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright (C) 2004-2007 Pavel Baranov
Copyright (C) 2004-2007 David Hobday
Licensed to FlowCode User under Single user Pro License for 1 node (s)
Limitations: PIC12, PIC16 max code size: Unlimited, max RAM banks: Unlimited
bar graph 16F887.c
Starting preprocessor: "E: \ Program Files \ Matrix Multimedia \ Flowcode V3 \ BoostC \ pp.exe" "F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c"-i "E: \ Program Files \ Matrix Multimedia \ Flowcode V3 \ BoostC \ include "-d _PIC16F887-la-c2-o" bar graph 16F887.pp "-v-d _BOOSTC-d _PIC16
...............................
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (366:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (366:2): error: failed to generate expression
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (367:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (367:2): error: failed to generate expression
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (368:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (368:2): error: failed to generate expression
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (369:2): error: unknown identifier 'LCD_RAM_Write'
F: \ Microcintrollers \ FlowCode Examples \ Flowcode 3 Examples from programm \ LCD_Custom_Characters \ bar graph 16F887.c (369:2): error: failed to generate expression
bar graph 16F887.c success
failure
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
FINISHED
- Attachments
-
- bar graph 16F887.fcf
- (6 KiB) Downloaded 482 times
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello
Did you update the LCD C code as shown in the article? If you didn't do this then this is the reason your program will not compile. If you did do this then please attach your C code to the forum and I will have a look for you.
Did you update the LCD C code as shown in the article? If you didn't do this then this is the reason your program will not compile. If you did do this then please attach your C code to the forum and I will have a look 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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
I did not change C code:
LCD_RAM_Write(0,0,0,0,0,0,0,0,31);
LCD_RAM_Write(1,0,0,0,0,0,0,31,31);
LCD_RAM_Write(2,0,0,0,0,0,31,31,31);
LCD_RAM_Write(3,0,0,0,0,31,31,31,31);
LCD_RAM_Write(4,0,0,0,31,31,31,31,31);
LCD_RAM_Write(5,0,0,31,31,31,31,31,31);
LCD_RAM_Write(6,0,31,31,31,31,31,31,31);
LCD_RAM_Write(7,31,31,31,31,31,31,31,31);
LCD_RAM_Write(0,0,0,0,0,0,0,0,31);
LCD_RAM_Write(1,0,0,0,0,0,0,31,31);
LCD_RAM_Write(2,0,0,0,0,0,31,31,31);
LCD_RAM_Write(3,0,0,0,0,31,31,31,31);
LCD_RAM_Write(4,0,0,0,31,31,31,31,31);
LCD_RAM_Write(5,0,0,31,31,31,31,31,31);
LCD_RAM_Write(6,0,31,31,31,31,31,31,31);
LCD_RAM_Write(7,31,31,31,31,31,31,31,31);
Respectfully, Alexander
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
I do not need to write to the memory of the indicator ( LCD_RAM_Write ), all the characters already written in my display. But I do not know how to call them. For example, how to call the symbol with address: Lower 4 bit: LHLH, Upper 4 bit: HLHL?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello
You can simply do this.
calculation icon:
byte = bx10100101
or
byte = 0xA5
LCD hardware macro:
LCD_Send_ASCII - Parameter: byte
You can simply do this.
calculation icon:
byte = bx10100101
or
byte = 0xA5
LCD hardware macro:
LCD_Send_ASCII - Parameter: byte
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Thank you, it works. But the program alloved to write byte = 0xA5. When I tried to write bx10100101 appeared message: One or more of calculation line are invalid. Why so?
Respectfully, Alexander
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
How is calling 8-bit address of the symbol for the 4-pin address D4-D7 of the indicator? Hence these pins of the indicator (D0-D3 and R/W) are not needed at all? Why then they did in the indicator?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello
Sorry the binary entry should look like this.
var = 0b10100101
D0-D3 are not needed when using the display in 4-bit mode. However they are used when using the display in 8-bit mode.
The R/W pin is used to control data direction. Eg you can use the display as a memory device. Only its not particularily useful so we have instead put the display into write mode only by grounding the R/W pin.
Sorry the binary entry should look like this.
var = 0b10100101
D0-D3 are not needed when using the display in 4-bit mode. However they are used when using the display in 8-bit mode.
The R/W pin is used to control data direction. Eg you can use the display as a memory device. Only its not particularily useful so we have instead put the display into write mode only by grounding the R/W pin.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Thank you, but what distinguishes the use of the LCD in 4-bit mode or 8-bit mode? LCD can display any characters in both modes?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello
The only difference is the way you communicate with the LCD. in 8-bit mode you clock all 8-bits into the LCD at once. In 4-bit mode you clock 4-bits in at a time and two successive 4-bit writes make up the 8-bit command. This is the only difference. At the front end there is no difference in operation.
The only difference is the way you communicate with the LCD. in 8-bit mode you clock all 8-bits into the LCD at once. In 4-bit mode you clock 4-bits in at a time and two successive 4-bit writes make up the 8-bit command. This is the only difference. At the front end there is no difference in operation.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Hi! Thank you for information, I have 1 more question. For what used string manipulation icon (example in Tut31) ? For what used PrintString of LCD macro?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello
Input_string = Input_string + Current_Char
or
Input_string = Input_string + 'H'
This takes the current string and adds the value contained within Current_Char to the end of the string.
TUT31 allows you to build up a string by using the three input buttons. I think the next tutorial TUT32 uses this method to input a password to unlock a device.
String manipulation icons are used for manipulating string variables. In the example TUT31 you have string manipulation icons contining code like this.For what used string manipulation icon (example in Tut31) ?
Input_string = Input_string + Current_Char
or
Input_string = Input_string + 'H'
This takes the current string and adds the value contained within Current_Char to the end of the string.
The Print string LCD macro prints a string of ASCII characters to the LCD. A string is essentially a collection of ASCII byte variables.For what used PrintString of LCD macro?
TUT31 allows you to build up a string by using the three input buttons. I think the next tutorial TUT32 uses this method to input a password to unlock a device.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Hi! Thank you for information. Now I'm trying to change the example TUT31 to use the buttons connected to bits A1, A2, A3 (now used A0, A1, A2), but I do not get. What should I do for this?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello Alex
Ok first of all you should edit the switch component connection properties to allow the alternative pins to be used in the simulation of the switches.
Then you need to change any the decision icons that use switch = x
Basically you will need to double x to get the new bit value.
Eg
switch = 1 becomes switch = 2
switch = 2 becomes switch = 4
etc..
You have to do it like this because in the example we are getting the switch values by reading an I/O port rather then using the switch component hardware macros.
In the properties of the input icon you should also check the masking to ensure that the pins you are interested in are being read and any pins your not interested in are not.
Ok first of all you should edit the switch component connection properties to allow the alternative pins to be used in the simulation of the switches.
Then you need to change any the decision icons that use switch = x
Basically you will need to double x to get the new bit value.
Eg
switch = 1 becomes switch = 2
switch = 2 becomes switch = 4
etc..
You have to do it like this because in the example we are getting the switch values by reading an I/O port rather then using the switch component hardware macros.
In the properties of the input icon you should also check the masking to ensure that the pins you are interested in are being read and any pins your not interested in are not.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Hi! Thank you, it works. I want to ask you about the Master Clear Enable in "Pic micro configuration". There I can choose 1 of 2 options: "MCLR is external" and "RE3 is digital input". MCLR and RE3 is 1 pin. How to use a hardware pin RE3 for the digital reset the controller?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello Alexander
The "MCLR is external" setting will use the RE3 pin as the reset pin. This pin must be held high by a 1K - 10K resistor from the 5v supply to allow the device to run. On our hardware this is already provided for you. The reset switch then forces the program to start from the beginning of memory.
The "RE3 is digital input" setting will allow you to use the pin as a digital input for your program. You can then control the input by pressing the onboard reset switch.
Unfortunatley the reset / IO pin cannot be used as an output even if you have disabled the MCLR functionality.
The "MCLR is external" setting will use the RE3 pin as the reset pin. This pin must be held high by a 1K - 10K resistor from the 5v supply to allow the device to run. On our hardware this is already provided for you. The reset switch then forces the program to start from the beginning of memory.
The "RE3 is digital input" setting will allow you to use the pin as a digital input for your program. You can then control the input by pressing the onboard reset switch.
Unfortunatley the reset / IO pin cannot be used as an output even if you have disabled the MCLR functionality.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Thank you, if I chose RE3 as a digital input, in this case, the logic levels on the RE3 will not affect on the controller reset? How can happen controller reset in this case?
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello Alexander
Yes if you use the digital input setting then the pin will no loger reset the chip.
If you need to reset the device then you can do this by toggling the power off and on or by enabling the watchdog timer in your configuration settings and then allowing it to overflow in software. The watchdog timer is quite advanced so I would avoid this while you are getting to grips with the software and device architecture.
Yes if you use the digital input setting then the pin will no loger reset the chip.
If you need to reset the device then you can do this by toggling the power off and on or by enabling the watchdog timer in your configuration settings and then allowing it to overflow in software. The watchdog timer is quite advanced so I would avoid this while you are getting to grips with the software and device architecture.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Thank you, how to do Autoclear watchdog timer in Flowcode 3? In Flowcode 4 I saw such an opportunity, but in FlowCode 3 I does not see how to make Autoclear watchdog timer.
Respectfully, Alexander
- 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: Customized characters on the LCD
Hello
Auto clear watchdog is a new feature for v4 and is not available in V3.
You can use the watchdog in v3 by using the c command clr_wtd(); to clear the timer.
If you have anything like second delays or millisecond delays larger then 1ms or 2ms in your program then you will need to break down these delays into sections using the clr_wdt(); command in between.
If you let the timer rollover then your device will perform a reset.
Auto clear watchdog is a new feature for v4 and is not available in V3.
You can use the watchdog in v3 by using the c command clr_wtd(); to clear the timer.
If you have anything like second delays or millisecond delays larger then 1ms or 2ms in your program then you will need to break down these delays into sections using the clr_wdt(); command in between.
If you let the timer rollover then your device will perform a reset.
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
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Thank you, I will try this. There is a problem at FlowCode 4 installation . What does this mean?
Respectfully, Alexander
-
- Posts: 79
- Joined: Mon Aug 03, 2009 12:14 pm
Re: Customized characters on the LCD
Thank you, I have successfully installed Flowcode4, but I have a problem, I can not open the menu Chip / Configure. What am I wrong?
Respectfully, Alexander