need help

Moderator: Benj

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

need help

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post 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
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post by jafal »

hi sir

this is my attempt i am very new

thanks alot
Attachments
Flowcode1.fcf
(9.5 KiB) Downloaded 247 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post 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
Attachments
LCD Keypad a.fcf
(10 KiB) Downloaded 257 times
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post by medelec35 »

Done!

Regards

Martin
Attachments
LCD Keypad 16F628A .fcf
(10 KiB) Downloaded 251 times
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post by medelec35 »

You're welcome.
Thanks for letting me know.

Martin
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post 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
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post by jafal »

hi sir

i have re-constricted the project its work and compiled to hex
Attachments
jafal.fcf
(10.5 KiB) Downloaded 243 times
jafal.hex
(4.71 KiB) Downloaded 217 times

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post by jafal »

hi sir


do you mean like this project ?
Attachments
jafal2.fcf
(7.5 KiB) Downloaded 161 times

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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
Attachments
jafal.fcf
(10.5 KiB) Downloaded 171 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post 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!
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post by medelec35 »

jafal wrote:if i want to use 12864 lcd
Sorry I don't know if flowcode V5 supports 12864 lcd.
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post by jafal »

Hi sir

thanks alot for your help

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post by medelec35 »

You need post your flowchart so I can see where your going wrong.

Martin
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post by jafal »

hi sir

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

regards
Attachments
Flowcode1 - Main.JPG
Flowcode1 - Main.JPG (25.72 KiB) Viewed 11151 times
Last edited by jafal on Sun Feb 04, 2018 1:27 am, edited 1 time in total.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: need help

Post 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.
Martin

jafal
Posts: 18
Joined: Sun Jan 28, 2018 9:14 pm
Has thanked: 5 times
Contact:

Re: need help

Post 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
Attachments
Flowcode1 - Main.JPG
Flowcode1 - Main.JPG (25.72 KiB) Viewed 11150 times

Post Reply