PROBLEMS TO DISPLAY DYNAMIC VALUES ON LCD SCREEN

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

PROBLEMS TO DISPLAY DYNAMIC VALUES ON LCD SCREEN

13,258 次查看
kilopondio
Contributor I
Hi all!.
 
I have a routine done in C of CODEWARRIOR that works pretty well but the only thing that I can show are messages but I cannot show dynamic values just like the content of an value updating in the LCD screen or temperature value, etc.
 
I use this function to send messages as follows:
 
void printf_LCD_4bits(unsigned to char row, unsigned to char column, to char * text)
{
 unsigned char adrs;
  
  adrs = columna - 1;

  if(fila == 2)
   adrs = adrs | 0x40;

 Ctrl4bits(adrs | 0x80);

 while(*text)
  
 Datos4bits(*text++);
}
 
I got the feeling that this routine would need some fourth argument inside the function so that I can manipulate other kind of values.
 
THe problem is that I`m not very familiar with C programming just as I make my own routine.
 
Please have mercy of me!!!!!!.
 
Thank you!
 
 
Kilopondio
 
 
 
 
标签 (1)
0 项奖励
回复
18 回复数

4,109 次查看
bespenschied
Contributor III
What happens when you send the Dynamic data? Do you get junk on the display?
0 项奖励
回复

4,109 次查看
peg
Senior Contributor IV


bespenschied wrote:
What happens when you send the Dynamic data? Do you get junk on the display?


Hi,

What happens is, it works as you would like it too.

Its just RAM, in your MCU you don't update the entire RAM block just to update 1 variable inRAM, do you?

No junk!

Regards Peg

 

0 项奖励
回复

4,109 次查看
kilopondio
Contributor I
Cheers
 
The compiler stops indicating an error .If you see the code that I put in here you'll notice that the function has 3 arguments and I thinks this should have 4 arguments just like  (row,column,text,value).
 
The problem is that I`m not familiarized with C lenguage and it`s driving me crazy!.
 
 
That`s all folk!.
 
You got it?
 
0 项奖励
回复

4,109 次查看
peg
Senior Contributor IV


kilopondio wrote:
Cheers
 
The compiler stops indicating an error .If you see the code that I put in here you'll notice that the function has 3 arguments and I thinks this should have 4 arguments just like  (row,column,text,value).
 
The problem is that I`m not familiarized with C lenguage and it`s driving me crazy!.
 
 
That`s all folk!.
 
You got it?
 


Well technically there was several problems with the posted code, But I though you were after more of a conceptual response.

Peg.


 

0 项奖励
回复

4,109 次查看
kilopondio
Contributor I
Dear...dear....dear... Peg:
 
More conceptual explanation????.....what is so difficult to understand here???.
 
It`s very simple to understand.
 
I have a function like this print_lcd_4bits (row,column,text) and I cannot display some dymanic value just like a counter value,temperature,etc.This functions just let me display text messages.
 
I just need some function that avoids me to be able to manipulate this kind of data.That`s all.
 
There are many things by which I am dealing with the bad humor as follows:
 
1) I don`t understand why the Freescale`s comunity is so closed to share appnotes and experience.
 
2) Notice that it is the fourth posted message and I still don`t get solution to my problem.
 
3) Feescale assumes ,by default, that all people have experience and we are all expert in C programming lenguage. (Codewarrior)
 
4) there is NO begginer user manual (Codewarrior) for the people who is starting up with this stuffs.All material is based upon especific appnotes for some kind of micros.I`m working especifically on 68HC908GP32 chip.
 
5) And what it is worst,it`s a very long time that I`m posting in some MOTOROLA micros forums that I have found around WITH NO SUCCESSFULL!.
 
I come from the Microchip comunity and it`s all much easiest world than this because it`s all well resolved, there are many appnotes to satisfy the problems where the people can get from.The problem is that I was forced to use MOTORLA chips.Otherwise, I could have used the PIC one.
 
I think this is not the right forum for people like me who is searching for to pay the rent every month.I just need to resolve very fast my project to be able to deliver it and get the money.I just can`t wait so long.
 
I believe that this is the right place adapted for enthusiastic students who like to investigate without no other class of preoccupations.
 
I don`t expect your help because of my words but I did want to tell my opinion.
 
 
Kindly regards.
 
 
Kilopondio
 
 
 
 
 
0 项奖励
回复

4,109 次查看
Alban
Senior Contributor II

I do acknowledge that you certainly have a bad mood.

If you had read existing posts, you would have found out Freescale position on the Communities.

  • Participation of Freescalers in on a voluntary basis only.
  • Problems blocking people's project MUST be submitted as a Service Request as it is the only way to have a formal support within a certain time frame.

kilopondio wrote:
(...)
I think this is not the right forum for people like me who is searching for to pay the rent every month.I just need to resolve very fast my project to be able to deliver it and get the money.I just can`t wait so long.
 
I believe that this is the right place adapted for enthusiastic students who like to investigate without no other class of preoccupations.
 

--> I will have to be strong here, but do you really think you can arrive here and insult and undermine everyone after one thread ???

Your difficulties in C have nothing to do with the fact you are using Freescale microcontrollers. You could use C code from PIC or include HC08 ASM.
Why are you not accusing the LCD manufacturer who didn't provide you with the .H header and .C function files ? Many, but many, many of those are available to download on the web, just by looking in Google.
One of the first Google results for ".C" LCD Nitron (thinking about a well known brand) is a website from a contributor with an example for an Hitachi disply using QY with the code ready to be used ...

Of course Application Notes are based on a specific device. Their are given to be on a specific device to demonstrate an example.
However, MOST of them are applicable to all the family. For instance, if it's on a Timer TIM08, it will apply on the TIM08 all across the board.

The Freescale Community was opened only few months ago and all Application Notes and Engineering Bulletins are available freely just by using the search engine at the top of each single page throughout Freescale website.

Addressing people the way you do will not bring you help !

If you don't respect the board and its members, just leave please.

Alban.

0 项奖励
回复

4,109 次查看
kilopondio
Contributor I
Dear Alban:
 
Evidently you have your brain very BURNEDDDDDD!!!!.
You are soooo bad behind the computer...
Sincerely I don`t matter what you think about me.
Your are blind too...why don`t see all my post to see my points intead of write moron things??????????.I neverrrrrrrrrrr told that I was programming in C lenguage.
My experience comes from PICBASIC and assembler lenguage!...pay attention!!!!!!.
From now I will talk to Airswit and Rhinoceroshead who were the only persons that really well known my problem and Resolved it.
I will not reply more threads from you and I don`t expect you understand that.......
 
Kilopondio
0 项奖励
回复

4,109 次查看
Alban
Senior Contributor II
User Banned.
0 项奖励
回复

4,109 次查看
peg
Senior Contributor IV

Hi all,

Well I,m glad all this transpired while I was asleep!

I'm not going to comment on kilopondio, that's well covered already.

What I will say is that this confusion often happens here.

People either don't give enough details, i.e. what MCU, what software (CW etc) how do they connect to the device?

OR

They don't indicate where they are having the problem:

e.g.

I understand what to do, but how do I implement it in C

OR I don't understand how to implement this in this MCU.

OR I have got no idea of the basic concept of how to get this done.

I am not having a whinge here, I could just go away.

Just hoping some people will be able to learn something from this thread.

Regards Peg

BTW thanks for the support (rocco knew what I was saying).

 

0 项奖励
回复

4,109 次查看
rhinoceroshead
Contributor I
Sorry, this was all my fault.  I mailed Kilopondio some fresh coffee, and I forgot about the time difference.  It appears that I should have sent beer.  Please accept my sincere apology.  I think we should double Peg's salary.  I will accept a 50% cut in my own.  :smileyhappy:
0 项奖励
回复

4,109 次查看
airswit
Contributor III
void printf_LCD_4bits(char row,char column,char * text,char value)
{
char adrs;

adrs = columna - 1;

if(fila == 2)
adrs = adrs | 0x40;

Ctrl4bits(adrs | 0x80);

while(*text)
Datos4bits(*text++);
Dataos4bits(':');
Dataos4bits( ((value%1000)/100)+0x30);
Dataos4bits( ((value%100)/10)+0x30);
Dataos4bits( (value%10)+0x30);
//^^should get you started with up to 3 digit number, kinda

}

Message Edited by airswit on 05-11-200608:51 AM

0 项奖励
回复

4,109 次查看
kilopondio
Contributor I
Cheers Airswi!.
 
Thank you so ,so so much for taking time to help me with my problem.You are very cool!.
 
I will try the routine you suggested me and I`ll tell you later.
 
Have a nice week buddy!.
 
 
Kilopondio
 
 
0 项奖励
回复

4,109 次查看
rhinoceroshead
Contributor I
If you have enough spare ROM on your device, you can include the stdio library and use the standard C print format functions to build your string and then use the function that you originally posted here to display the string.  Here's how that would work:
 
Add this at the top of your source file:
 
#include <stdio.h>
 
Then you have to declare a chunk of memory to hold the string:
 
char text[17];  //for a 16 digit display
 
Then suppose you want to write this to your display, "time: 145 us" and the number 145 is stored in the integer called "time".
 
sprintf(text, "time: %d us", time);  // this will replace the %d with the value of time
printf_LCD_4bits(row, col, text);  // assuming this function writes a string
 
I have done this many times.  It allows you to display dynamic ints, strings, floats, and it already handles things like negative sign display, truncating, displaying hex numbers - and it is very well documented on the Internet.  It is not nearly as efficient as the method that Peg and airswit are describing, but if your application is not time critical and if you have lots of spare flash, it is very easy to use.  You can also do multiple dynamic values like this:
 
sprintf(text, "time: %d:%d.%d", min, sec, ms);
printf_LCD_4bits(row,col,text);
 
which, if min = 3, sec = 31 and ms = 456, your display will show this:
"time: 3:31.456"
 
For floats, it allows you to define how many decimal places to include:
 
sprintf(text, "%.3f inches", in);
 
So if you have the number 123.456789 stored in a float, then it will display:
"123.456 inches"
 
Also, you should not be attacking Peg - who is probably the most active contributor on this forum - and Peg does this out of goodwill and was not intending to mock you in any way.  It is your responsibility to make the check appear every month - not Freescale's and not Freescale's forum.  I happen to prefer the Freescale microcontrollers over the PICs - and it's probably just because I am inexperienced with PICs.  Being an expert at one device doesn't make the other ones inferior.  You will get more useful help on ANY forum if you are courteous, grateful and willing to provide information and accept that the contributors can not read your mind.
0 项奖励
回复

4,109 次查看
kilopondio
Contributor I
My friend Rhinoceroshead:
 
I understand with humility your point of view but I believe that you didn`t  interpret so well some points that I mentioned before .  I do accept that other people do not think like me but what bothers me much is the people who criticize and do not help. I simply exposed my annoyance.
I believe that the critic must be accompanied of a solid idea.Peg inquired me that I didn`t give a "conceptual explanation".I have posted 4 times my problem and he didn`t do anything In order to help to solve my problem.He`s got no obligation to do this but then I don`t accept any critics.     
 Please don`t be confused.I never told that the forum people have the fault of my  problems.I just simply told that it seemed  this forum was a little closed.
 
 I appreciate your effort and I wish you have a nice week!.
 
 
Greetings
 
Kilopondio
0 项奖励
回复

4,109 次查看
rocco
Senior Contributor II
Hi, Kilopondio:

I think we simply had a miscommunication. I understand that there are often language barriers with this board, and I think this thread is a manifestation of that.

Peg did not ask for a "conceptual explanation". I think Peg thought (as did I) that you were asking for a conceptual explanation, and actually provided one (and a good one, IMHO). You did not say in your original post that you really wanted code.

Keep in mind that it is often hard to understand technical posts when not everyone is fluent in english.
0 项奖励
回复

4,109 次查看
Alban
Senior Contributor II
Hi Rocco & Kilopondio,
 
I do understand communications problem can occur because of different language.
English is not my mother tongue either.
However I try to stay calm and ask courteously when I don't understand something. And Peg statement was clear...
 
As long as I am granted the "privilege" of being Moderator, I will not tolerate insults or attacks.
I'm not looking for reward for the huge amount of time I and everybody else is spending on those boards. Still, I expect everyone to be treated properly for the Contribution they offer freely and voluntarily.
 
Kind Regards,
Alban. {Not Mod 4 long ?!}
 
 
0 项奖励
回复

4,109 次查看
kilopondio
Contributor I

To Rhinoceroshead:

                                 Thank you very very much for your help.You are very cool guy!.

 

 

To Airswit:

                Brother,you are a genious.Thanks to you my problem is over!!..The routine you modificated me just worked out OK!!!!.You are a very cool guy too.

Guys you show me that there are cool people yet...

Greetings!.

 

Kilopondio

0 项奖励
回复

4,109 次查看
peg
Senior Contributor IV

Hi kilopondio,

Normally I would use 1 function to write all the static data to the lcd like:

The temp is xx degrees.

Then call another function at some kind of update rate (maybe up to 3 times a second but probably not for temperature) which just writes the data value over the top of the old value. If its just one character or maybe two you could use cursor shift left then write or just set the DD RAM address to the first character. The second function would probably take a position and a value rather than a string.

Hope this helps

Regards Peg

 

0 项奖励
回复