getting demo limit error.

General discussion on mikroC PRO for 8051.
Post Reply
Author
Message
superhuman
Posts: 8
Joined: 07 Jul 2013 16:45

getting demo limit error.

#1 Post by superhuman » 06 Aug 2013 06:30

Hello everyone,
Is there any way i can print numbers to the LCD display?

I tried converting the number to a string and then printing it on the LCD.

1.

Code: Select all

void main() {
  char mystringarray[10] = "\0";
  int test_num = 0;
  sprintf(mystringarray,"%d",test_num);

//will print mystringarray to lcd
}
I get a "demo limit" error.not sure what it means...

2.
I tried using itoa() function,but its not defined in the inbuilt library,so it gives me an error?

Can you suggest me any other alternative...

Thanks in advance.

MaGiK
Posts: 897
Joined: 19 Apr 2013 10:00

Re: getting demo limit error.

#2 Post by MaGiK » 06 Aug 2013 09:00

Hi SuperHuman :D

I'm not sure about the commands and libraries you are using for the LCD. I'm not an expert there.

However, the (Demo Limit) error occurs when you are working on the free compiler version and your program exceeds the allowed size for compilation, (Which is 4096 bytes for your case).
To solve this issue, you need to buy one of the 8051 compilers.

There are three 8051 compilers, they are:

1- Mikro-C PRO for 8051:
http://www.mikroe.com/mikroc/8051/

2- Mikro-BASIC for 8051:
http://www.mikroe.com/mikrobasic/8051/

3-Mikro-Pascal for 8051:
http://www.mikroe.com/mikropascal/8051/

To explain it a little more, for each of these compilers, you can download a demo version (for free) from its page that I gave you the link for, but that version will only allow you to program a small part of your program memory.

The size of that small part is mentioned in the page of the compiler, (In the same place where you can download your free version to be exact). That size is 4096 bytes for 8051.

If your program size exceeded that small part, then you'll get a (Demo Limit) error.
And to unlock the rest of the program memory of 8051, you need to buy one of those compilers.

By the way, some 8051 products include a CD with them, among the contents of the CD is also a Demo version of all the compilers, not a full version.

Best Regards.
My hobby is collecting MikroElektronika products.
Gotta catch them all!

superhuman
Posts: 8
Joined: 07 Jul 2013 16:45

Re: getting demo limit error.

#3 Post by superhuman » 07 Aug 2013 08:53

Hello MaGiK,
Thanks for your reply,but i am pretty sure that the above code is less than the specified size(4Kb).
I verified it by using another compiler(Keil) and it worked without any problems.So i guess i must be doing something wrong...

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: getting demo limit error.

#4 Post by dejan.odabasic » 07 Aug 2013 12:10

Hello,

MaGiK is correct. Demo limit message is shown only for the code which is larger then 4096 bytes.
Using the Sprintf library alone is enough to reach the Demo limit.

Best regards.

superhuman
Posts: 8
Joined: 07 Jul 2013 16:45

Re: getting demo limit error.

#5 Post by superhuman » 07 Aug 2013 12:52

Hello dejan.odabasic,
I see, can you suggest me any other way i can print numbers on LCD display?

Many thanks :)

User avatar
dejan.odabasic
mikroElektronika team
Posts: 2649
Joined: 30 Apr 2012 14:20

Re: getting demo limit error.

#6 Post by dejan.odabasic » 08 Aug 2013 16:53

Hello,

You could try using Conversions library instead of sprintf library.

Code: Select all

void main() {
  char mystringarray[10] = "\0";
  int test_num = 0;
  IntToStr(test_num,test_num);
//will print mystringarray to lcd
}
Best regards.

jayanthd
Posts: 630
Joined: 08 May 2013 18:31
Location: Bangalore

Re: getting demo limit error.

#7 Post by jayanthd » 14 Oct 2013 20:56

Code: Select all

void main() {
  char mystring[17] = "";
  long test_num = 123456789;

  IntToStr(test_num, mystring);
  LCD_Out(1,1, myString);
}
[HW:] EasyPIC v7, mikroProg PIC, AVR, STM32, PSoC, Tiva, 8051
[SW:] mikroC PRO PIC, dsPIC, PIC32, AVR, ARM, 8051
mikroBasic PRO PIC, dsPIC, PIC32, AVR, ARM, 8051
mikroPascal PRO PIC, dsPIC, PIC32, AVR, ARM, 8051
Visual GLCD, Visual TFT

Post Reply

Return to “mikroC PRO for 8051 General”