Page 1 of 2

need help

Posted: Mon Jan 29, 2018 9:08 am
by jafal
hi

i am new user for flowcode i need to run lcd 16 * 2 with pic 16f877 with keybad i need when to print number stay at its

position and the other numuber in the next digit and so on until the 32 characters displayed when hit the keybad

regards

Re: need help

Posted: Mon Jan 29, 2018 9:53 am
by medelec35
Hi jafal,
Welcome to the forums.
If it was me, I would use a count variable (initial value = 0) that increments each time a key is pressed.
Then use a discussion branch:

Code: Select all

If count = 17 then LCD cursor x=0, y=1
.
Finally use

Code: Select all

LCD PrintNumber
function
If you become stuck then post Flowchart and I will help you further.

It's highly recommended to learn from the Learning centre found under support menu of the forums.

Martin

Re: need help

Posted: Mon Jan 29, 2018 10:07 am
by jafal
hi sir

thanks for replay

if you pleas post to me the flow chart of all project

show me how to do it i am trying to train

regards

Re: need help

Posted: Mon Jan 29, 2018 10:12 am
by jafal
hi sir

this is my attempt i am very new

thanks alot

Re: need help

Posted: Mon Jan 29, 2018 10:31 am
by medelec35
Attached is one way.
As you said 2x16 I have changed it to that LCD.
I have also changed target device to 16F877.
If you want to make it do something in addition, then see if you can modify it and upload back on this thread.

Martin

Re: need help

Posted: Mon Jan 29, 2018 11:01 am
by jafal
hi sir

thanks very much again the cfc file did not open iam using the demo flow code i think its work just on 16f877a not 16f877

if its not hard for you and if you pleas can you modifies the 16f877 to 16f628a and iam very thankful for your co-operation

many thanks for you

regards

Re: need help

Posted: Mon Jan 29, 2018 11:17 am
by medelec35
Done!

Regards

Martin

Re: need help

Posted: Mon Jan 29, 2018 11:43 am
by jafal
hi sir

thanks a lot it works

thanks for your help

i am going to try some stuffs with this project and i am going to need farther help from you

many thanks

Re: need help

Posted: Mon Jan 29, 2018 11:56 am
by medelec35
You're welcome.
Thanks for letting me know.

Martin

Re: need help

Posted: Tue Jan 30, 2018 1:58 am
by jafal
medelec35 wrote:You're welcome.
Thanks for letting me know.

Martin


hi sir


while i am trying to compile the file to hex i received this massage ..



File name: C:\Users\jafal\Desktop\flownew\LCD Keypad 16F628A (1).c



Launching the compiler...
C:\Program Files\Flowcode\v5\Tools\boostc\boostc_pic16_flowcode.exe -v -t PIC16F628A "LCD Keypad 16F628A (1).c"
BoostC Optimizing C Compiler Version 7.04 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2011 Pavel Baranov
Copyright(C) 2004-2011 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


LCD Keypad 16F628A (1).c
Starting preprocessor: C:\PROGRA~1\Flowcode\v5\Tools\boostc\pp.exe "LCD Keypad 16F628A (1).c" -i C:\PROGRA~1\Flowcode\v5\Tools\boostc\include -d _PIC16F628A -la -c2 -o "LCD Keypad 16F628A (1).pp" -v -d _BOOSTC -d _PIC16 -d _CHAR_INDEX

LCD Keypad 16F628A (1).c(580): error: missing right paren
LCD Keypad 16F628A (1).c(580): error: missing semicolon
LCD Keypad 16F628A (1).c(580): error: missing right paren
LCD Keypad 16F628A (1).c(574): error: failure

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


:wink: :wink: :wink: :wink:



the fcf of my file was compiled successfully


whats gone wrong with me ??



regaeds

Re: need help

Posted: Tue Jan 30, 2018 8:45 am
by medelec35
Sorry,
I should of mentioned you need to assign your own connections to keypad.
On the panel, right click on the keypad & select Connections.
Make sure there are no Unconnected showing so you must assign every connection.

If there are any Unconnected showing then when compiling to hex or chip, you will get

Code: Select all

LCD Keypad 16F628A (1).c(580): error: missing right paren
LCD Keypad 16F628A (1).c(580): error: missing semicolon
LCD Keypad 16F628A (1).c(580): error: missing right paren
LCD Keypad 16F628A (1).c(574): error: failure
Note If you are going to use the chip you have stated then, you will not be able to use a crystal to drive it.
It must be changed to use internal oscillator.
To use internal oscillator, a C code block must be placed at the very start of main with an osccon value within it.
See this post to select correct value.
Although 16F628a can't go as high as 32MHz.

Also you can't use RA5 for LCD as it's an input only.


Alternatively you can use 16F1937 as that is allowed with the free version.
All free version microcontrollers:

Code: Select all

 : 16F84A, 16F628A, 16F690, 16F88, 16F877A, 16F887, 16F1937, 18F4431, 18F2220, Formula Flowcode Buggy, ECIO-40, ECIO-28, MIAC, Locktronics PIC
Martin

Re: need help

Posted: Tue Jan 30, 2018 9:19 am
by jafal
hi sir

i have re-constricted the project its work and compiled to hex

Re: need help

Posted: Tue Jan 30, 2018 9:28 am
by jafal
hi sir again


its hard to find but those pics in my country 16f877/a 16f628 and 2 or three of 18f"sxxxxxx

i did not got it that i cant use the out Crystal

if i used the hex that i complied directly to chip wont work ?

if you plz explain to my how to run this project on chip

regards

Re: need help

Posted: Tue Jan 30, 2018 9:46 am
by jafal
hi sir


do you mean like this project ?

Re: need help

Posted: Tue Jan 30, 2018 9:51 am
by jafal
hi sir


at the start of flowchart i have to put this in order to control the frequency with out external crystal


osccon=0x78; // 32Mhz (4xPPL+4meg)


is that your point ?

regards

Re: need help

Posted: Tue Jan 30, 2018 10:01 am
by jafal
hi sir

i think i understand

if you please re-write the project if your time allows


add the code of the crystal

Re: need help

Posted: Tue Jan 30, 2018 10:40 am
by medelec35
jafal wrote:at the start of flowchart i have to put this in order to control the frequency with out external crystal


osccon=0x78; // 32Mhz (4xPPL+4meg)
I did state:
medelec35 wrote:Although 16F628a can't go as high as 32MHz.
You will need to download the datasheet for 16F628A.
use Ctrl F to search datasheet for osccon
You should see a page similar to the page shown in the link I posted.
There you should see all the frequencies that can be used.
Once you have found your desired frequency then calculate correct osccon value.
Best advice when developing any project is to do the one second flasher test!

Re: need help

Posted: Tue Jan 30, 2018 11:11 am
by jafal
hi sir

i understand now thanks for your help


if i want to use 12864 lcd what should i do to move the cursor from first digit to last digit

with 16 * 2 was

If count = 17 then LCD cursor x=0, y=1

how to do it with 12864


thanks in advance

regardes

Re: need help

Posted: Tue Jan 30, 2018 12:31 pm
by medelec35
jafal wrote:if i want to use 12864 lcd
Sorry I don't know if flowcode V5 supports 12864 lcd.

Re: need help

Posted: Tue Jan 30, 2018 2:45 pm
by jafal
Hi sir

thanks alot for your help

Re: need help

Posted: Sat Feb 03, 2018 7:31 am
by jafal
Good morning sir


I have try a lot to print the numbers on lcd 16 * 4 but each time i got bad results i couldn't control the digit in the exact

place help me how to print using lcd 16 * 4


regards

Re: need help

Posted: Sat Feb 03, 2018 6:20 pm
by medelec35
You need post your flowchart so I can see where your going wrong.

Martin

Re: need help

Posted: Sun Feb 04, 2018 1:05 am
by jafal
hi sir

i want to run the keybad digit by digit for the 4 lines

regards

Re: need help

Posted: Sun Feb 04, 2018 1:24 am
by medelec35
Sorry unable tell from that.
Can't help without a flowchart.
Only if you want to keep it private then you pm it.

Re: need help

Posted: Sun Feb 04, 2018 1:31 am
by jafal
medelec35 wrote:Sorry unable tell from that.
Can't help without a flowchart.
Only if you want to keep it private then you pm it.

hi
this is the flowchart