Connecting a alphanumeric LCD to Flowcode
- 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: Connecting a alphanumeric LCD to Flowcode
Hello
You may need to check your project options to ensure you are running at the correct clock speed. If you have the HS mode selected and features like the watchdog and the LVP disabled then this should be correct for your setup.
8-bit communications is possible by using the code customization features of Flowcode v4. Though 8-bit communications is generally throwing away i/o for little gain.
You may need to check your project options to ensure you are running at the correct clock speed. If you have the HS mode selected and features like the watchdog and the LVP disabled then this should be correct for your setup.
8-bit communications is possible by using the code customization features of Flowcode v4. Though 8-bit communications is generally throwing away i/o for little gain.
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: Connecting a alphanumeric LCD to Flowcode
Hello BenJ,
I disabled the watchdog and the low power programming, but still nothing... I did look in the C code and the cristal is 12Mhz. With a scope I checked the pins and there is a 5 Volt puls on all 6 pins. Is there a slow reset problem that you know of?
Thanks fos the advice.
ASDned
I disabled the watchdog and the low power programming, but still nothing... I did look in the C code and the cristal is 12Mhz. With a scope I checked the pins and there is a 5 Volt puls on all 6 pins. Is there a slow reset problem that you know of?
Thanks fos the advice.
ASDned
- 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: Connecting a alphanumeric LCD to Flowcode
Hello
The code should be working ok unless you have a damaged LCD module.
Here are the main causes for problems with an LCD.
Incorrect clock speed - Create a simple program that flashes an LED with 1second delays. This confirms if you have the clock speed correct in Flowcode.
Incorrect configuration - Create a simple program that flashes an LED with 1second delays. This confirms if you have the configuration correct in Flowcode.
Incorrect wiring / connections - Check that the data pins in Flowcode go to the high nibble of the data bus on the LCD.
If you have the low voltage programming configuration enabled then you will loose an I/O pin normally right in the middle of PortB.
The code should be working ok unless you have a damaged LCD module.
Here are the main causes for problems with an LCD.
Incorrect clock speed - Create a simple program that flashes an LED with 1second delays. This confirms if you have the clock speed correct in Flowcode.
Incorrect configuration - Create a simple program that flashes an LED with 1second delays. This confirms if you have the configuration correct in Flowcode.
Incorrect wiring / connections - Check that the data pins in Flowcode go to the high nibble of the data bus on the LCD.
If you have the low voltage programming configuration enabled then you will loose an I/O pin normally right in the middle of PortB.
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
- 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: Connecting a alphanumeric LCD to Flowcode
Hello
The code should be working ok unless you have a damaged LCD module.
Here are the main causes for problems with an LCD.
Incorrect clock speed - Create a simple program that flashes an LED with 1second delays. This confirms if you have the clock speed correct in Flowcode.
Incorrect configuration - Create a simple program that flashes an LED with 1second delays. This confirms if you have the configuration correct in Flowcode.
Incorrect wiring / connections - Check that the data pins in Flowcode go to the high nibble of the data bus on the LCD.
If you have the low voltage programming configuration enabled then you will loose an I/O pin normally right in the middle of PortB.
PortA Pin 4 cannot source current on quite a few PICmicro devices.
The code should be working ok unless you have a damaged LCD module.
Here are the main causes for problems with an LCD.
Incorrect clock speed - Create a simple program that flashes an LED with 1second delays. This confirms if you have the clock speed correct in Flowcode.
Incorrect configuration - Create a simple program that flashes an LED with 1second delays. This confirms if you have the configuration correct in Flowcode.
Incorrect wiring / connections - Check that the data pins in Flowcode go to the high nibble of the data bus on the LCD.
If you have the low voltage programming configuration enabled then you will loose an I/O pin normally right in the middle of PortB.
PortA Pin 4 cannot source current on quite a few PICmicro devices.
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: Connecting a alphanumeric LCD to Flowcode
Hello Ben,
I did a measurement wiyh a frequention counter amd measured a stable 20Mhz instead of the 12Mhz it should be (in the manual and on the xtal). I changed it in the software and flashed again but still nothing... so I made a led burn for 60 seconds and timed it and it is exact 60 seconds so no brain waves about that anymore. I did check the wires again and again so I think also that the LCD is corupted. I wil let you know wath it was.
Hear from me soon,
ASDned
I did a measurement wiyh a frequention counter amd measured a stable 20Mhz instead of the 12Mhz it should be (in the manual and on the xtal). I changed it in the software and flashed again but still nothing... so I made a led burn for 60 seconds and timed it and it is exact 60 seconds so no brain waves about that anymore. I did check the wires again and again so I think also that the LCD is corupted. I wil let you know wath it was.
Hear from me soon,
ASDned
Re: Connecting a alphanumeric LCD to Flowcode
Hello ben,
I was bizzy with exams but in some spare time I did try the following. I have used the MicroC Pro and programmed the LCD demo and it did work straight away. So it is somethimg in the timing to the LCD and Flowcode with this board I use. If I am right this is a problem for more Flowcode users?
Best regards,
Boris.
I was bizzy with exams but in some spare time I did try the following. I have used the MicroC Pro and programmed the LCD demo and it did work straight away. So it is somethimg in the timing to the LCD and Flowcode with this board I use. If I am right this is a problem for more Flowcode users?
Best regards,
Boris.
- 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: Connecting a alphanumeric LCD to Flowcode
Hello Boris,
Any chance you can send me your Flowcode file and I will look into this for you and see if I can spot anything further.
Any chance you can send me your Flowcode file and I will look into this for you and see if I can spot anything further.
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: Connecting a alphanumeric LCD to Flowcode
Hi everybody
I face problem with LCD it's just light and don't display any char
I am use Pic16f877a with config word 0x393a
simulation ok but when I run my device that's what happen
I face problem with LCD it's just light and don't display any char
I am use Pic16f877a with config word 0x393a
simulation ok but when I run my device that's what happen
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
Hi Maher,
What you are seeing is an uninitialized LCD.
Either:
1) LCD connections wrong, Open or short circuit.
Here is how LCD Eblock is wired up (page 7), which may help.
2) Flowchart chip configuration is wrong. E.g watchdog, low voltage programming enabled
3) Hardware has an issue e.g crystal or associated components faulty.
MCLR is enabled, but on hardware is not tied to + supply
My advice would be to connect a resistor & LED and make a 1Hz flasher.
See this link
If you're not sure about flowchart settings, if you post you're flowchart then I can have a look at it for you.
A circuit diagram may help.
Martin.
What you are seeing is an uninitialized LCD.
Either:
1) LCD connections wrong, Open or short circuit.
Here is how LCD Eblock is wired up (page 7), which may help.
2) Flowchart chip configuration is wrong. E.g watchdog, low voltage programming enabled
3) Hardware has an issue e.g crystal or associated components faulty.
MCLR is enabled, but on hardware is not tied to + supply
My advice would be to connect a resistor & LED and make a 1Hz flasher.
See this link
If you're not sure about flowchart settings, if you post you're flowchart then I can have a look at it for you.
A circuit diagram may help.
Martin.
Martin
Re: Connecting a alphanumeric LCD to Flowcode
Thank you Martin
I check circuit no short or open circuit and the Flowchart chip configuration is right (0x393A) and another
look these photos
this configuration in Topwin 2005 programmer
and the simulation run without problems
this is the code
http://up.top4top.net/downloadf-top4top ... 1-rar.html
what should i do?
I check circuit no short or open circuit and the Flowchart chip configuration is right (0x393A) and another
look these photos
this configuration in Topwin 2005 programmer
and the simulation run without problems
this is the code
http://up.top4top.net/downloadf-top4top ... 1-rar.html
what should i do?
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
Hi Maher,
How odd?
WDTEN and LVP must not be selected
When I load your hex file with my programmer: Since with your programmer LVP is enabled that alone will stop LCD from working.
So you can test hardware you can always manually change the fuse settings on your programming software to match configuration settings of flowcode.
The programmer is not reading fuses correctly yet config value looks correct.Maher wrote: this configuration in Topwin 2005 programmer
How odd?
WDTEN and LVP must not be selected
When I load your hex file with my programmer: Since with your programmer LVP is enabled that alone will stop LCD from working.
So you can test hardware you can always manually change the fuse settings on your programming software to match configuration settings of flowcode.
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
Hi Martin
yes it is working but there is another problem when i want use keypad it is take number without press any key ( the connection of keypad is c1:PortD4
c2:PortD5
c3:PortD6
rowA:portC4
rowB:PortC5
rowC:PortC6
rowD:PortC7)
I connect terminal of keypad without resistor between them and pins of micro
yes it is working but there is another problem when i want use keypad it is take number without press any key ( the connection of keypad is c1:PortD4
c2:PortD5
c3:PortD6
rowA:portC4
rowB:PortC5
rowC:PortC6
rowD:PortC7)
I connect terminal of keypad without resistor between them and pins of micro
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
Thank you Martin
yes I should use pull down resistors
can you help me
I use SY_HS_220 Humidity sensor
PIC16f877A : ADC(1) for humidity sensor
ADC1_VALUE:ReadAsInt()
HUMIDITY = (ADC1_VALUE * 5.0 * 33.0) / 1024.0
in data sheet of sensor the output voltage is 2970mv for 90%RH
And 990mv for 30%RH
(2970-990)/(90-60)=33
but when I read the value of humidity from sensor it upper than 120%RH
where is my mistake
and thank you very much
yes I should use pull down resistors
can you help me
I use SY_HS_220 Humidity sensor
PIC16f877A : ADC(1) for humidity sensor
ADC1_VALUE:ReadAsInt()
HUMIDITY = (ADC1_VALUE * 5.0 * 33.0) / 1024.0
in data sheet of sensor the output voltage is 2970mv for 90%RH
And 990mv for 30%RH
(2970-990)/(90-60)=33
but when I read the value of humidity from sensor it upper than 120%RH
where is my mistake
and thank you very much
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
Hi Maher,
Your calculations will cause issues if not using floats:
Take a look here
That should help,
Unless you're using floats as I can see you have a .0 at the end of each number.
If you can post a flowchart, I can have a look at it for you.
Edit just a thought.
Try this:
Using ReadAsInt
and Humidity variable as an Byte (saves ROM).
Within a calculation box:
HUMIDITY = ADC1_VALUE * 7 / 50 + 5
Martin
Your calculations will cause issues if not using floats:
Take a look here
That should help,
Unless you're using floats as I can see you have a .0 at the end of each number.
If you can post a flowchart, I can have a look at it for you.
Edit just a thought.
Try this:
Using ReadAsInt
and Humidity variable as an Byte (saves ROM).
Within a calculation box:
HUMIDITY = ADC1_VALUE * 7 / 50 + 5
Martin
Martin
Re: Connecting a alphanumeric LCD to Flowcode
Hi Martin
I used Floating point variable (HUMIDITY)
ADC1_VALUE (integer)
look that
and the character of sensor is
I used Floating point variable (HUMIDITY)
ADC1_VALUE (integer)
look that
and the character of sensor is
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
Hi Maher,
Try with the formula I posted above without using floats.
Martin
Try with the formula I posted above without using floats.
Martin
Martin
Re: Connecting a alphanumeric LCD to Flowcode
can you explain why use this formula
Using ReadAsInt
and Humidity variable as an Byte (saves ROM).
Within a calculation box:
HUMIDITY = ADC1_VALUE * 7 / 50 + 5
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
It's a formula I made up to give and approx humidity reading for a give i/p voltage.
But I have made a mistake I used min Humidity of 33% and not 30%
So instead of HUMIDITY = ADC1_VALUE * 7 / 50 + 5
Then use ADC1_VALUE * 3 / 20
e.g
For H30% datasheet shows V= 0.990V
ADC variable will be 1023/5*0.990 = 201 (rounding down)
put that into the formula & rounding down:
Humidity = 201 * 3 / 20 = 30
For H90% datasheet shows V= 2.970V
ADC variable will be 1023/5*2.970 = 607 (rounding down)
put that into the formula & rounding down:
Humidity = 607 * 3 / 20 = 91
Not far off.
It's not worth using the memory hungry floats if there is no precision involved, e.g just in table form:
30 = 990
40 = 1300
etc.
Martin
But I have made a mistake I used min Humidity of 33% and not 30%
So instead of HUMIDITY = ADC1_VALUE * 7 / 50 + 5
Then use ADC1_VALUE * 3 / 20
e.g
For H30% datasheet shows V= 0.990V
ADC variable will be 1023/5*0.990 = 201 (rounding down)
put that into the formula & rounding down:
Humidity = 201 * 3 / 20 = 30
For H90% datasheet shows V= 2.970V
ADC variable will be 1023/5*2.970 = 607 (rounding down)
put that into the formula & rounding down:
Humidity = 607 * 3 / 20 = 91
Not far off.
It's not worth using the memory hungry floats if there is no precision involved, e.g just in table form:
30 = 990
40 = 1300
etc.
Martin
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: Connecting a alphanumeric LCD to Flowcode
How did you get on with the new formula?
I'm going to move part of this thread, as we are posting in the wrong section.
So its moved to the correct section, what verson of flowcode are you using?
E.g V4, V5
Free, Home or Professional?
I'm going to move part of this thread, as we are posting in the wrong section.
So its moved to the correct section, what verson of flowcode are you using?
E.g V4, V5
Free, Home or Professional?
Martin