Newbie frustration.

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
lungchard
Flowcode v5 User
Posts: 19
Joined: Wed Aug 14, 2013 3:53 pm
Location: Thailand
Has thanked: 1 time
Been thanked: 3 times

Newbie frustration.

Post by lungchard »

Hello Forum,
Can you please help a new starter find a simple problem with his first attempts.
I want to read a PIC SFR (tmr1l) and display on LCD. My LCD shows some values that exceed 255.
Any idea why this may be happening? Should be 8 bits only.
Thanks in advance. Richard.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: Newbie frustration.

Post by dazz »

HI
First off welcome, can you follow the link in my sig and sign up to the relevant forum as you will get more help ,can you also post your flowchart as you will get more help if someone can see what your trying to do in flowcode

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

lungchard
Flowcode v5 User
Posts: 19
Joined: Wed Aug 14, 2013 3:53 pm
Location: Thailand
Has thanked: 1 time
Been thanked: 3 times

Re: Newbie frustration.

Post by lungchard »

Hello Dazz,
I am registered forum member but posted here as it seemed to be best suited for my question.
What they need is a newbies section so we do not clutter the pro forum with trivia!
Have attached my attempt. It was originally posted on internet by Roman Black.
I have tried to copy it using flow code (original was in MikroC) but not been sucessfull.
Thanks for your time.
Richard.
Attachments
My Tester3.fcf
(8.5 KiB) Downloaded 290 times

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: Newbie frustration.

Post by dazz »

HI
i missed your were registered sorry
nothings trivial and every question is valid
can you link to the original code and a description of what it does so i can have a closer look

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

lungchard
Flowcode v5 User
Posts: 19
Joined: Wed Aug 14, 2013 3:53 pm
Location: Thailand
Has thanked: 1 time
Been thanked: 3 times

Re: Newbie frustration.

Post by lungchard »

Hello Dazz,
I will send original code.
I am just using it as a learning experience as it will be useful to me later.
In brief, i have declared a variable (RJH), then RJH=TMR1L then used lcd block to send it.
I get values but bigger than i expect.
The original code is more complex but you can see where i got my attempt from.
Appreciate your time.
Richard.
Attachments
XTAL_Calib.c
(3.58 KiB) Downloaded 320 times

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Newbie frustration.

Post by Spanish_dude »

That's strange ... Your RJH is an 8 bit variable and the TMR1L is 8 bit too.
Have you tried setting RJH to, let's say, 127 and see if it still shows values bigger than 255 ?

I don't see anything wrong in the code though...

- Nicolas

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

Re: Newbie frustration.

Post by medelec35 »

Hi Richard,
I know whats going on.
Your not clearing a space display after the last digit.
For example 1st value is 152
Then if the second sample is 68
since not printing " " after 152
then the display will show 682 even though it is a byte that has been printed (since the 2 will remain from the previous number).
Its just an LCD formatting issue.
I have attached a modified Flowchart.

If you need any further help then let us know.

Martin

P.s. since you now a registered V5 user, I will move this topic to a more suitable section of the forum :)
Attachments
My Tester4.fcf
(9 KiB) Downloaded 302 times
Martin

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Has thanked: 474 times
Been thanked: 458 times

Re: Newbie frustration.

Post by dazz »

HI
have a quick check of attached flowchart, you will have to work out the ccp and tmr 1, but most of c file converted to flowcode, you should be able to work out what goes where if you check the c and flowchart side by side ( timers and ccp im not very good at)

Regards
Dazz
tt.fcf
(10 KiB) Downloaded 337 times
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

lungchard
Flowcode v5 User
Posts: 19
Joined: Wed Aug 14, 2013 3:53 pm
Location: Thailand
Has thanked: 1 time
Been thanked: 3 times

Re: Newbie frustration.

Post by lungchard »

Dazz/medelec35,

Thanks for the help.
Now working as i wanted.
One tip for the crib sheet i think.

Best Regards

Richard Hogan.

Spanish_dude
Posts: 594
Joined: Thu Sep 17, 2009 7:52 am
Location: Belgium
Has thanked: 63 times
Been thanked: 102 times

Re: Newbie frustration.

Post by Spanish_dude »

medelec35 wrote:...
For example 1st value is 152
Then if the second sample is 68
since not printing " " after 152
then the display will show 682 even though it is a byte that has been printed (since the 2 will remain from the previous number).
Its just an LCD formatting issue.
...
How did I not see that... *facepalm*

- Nicolas

Post Reply