Page 2 of 2

Re: New GLCD project for 18F2550

Posted: 27 Jul 2010 04:46
by inspirational4real
Hi guys, I have tweaked this code a bit based on the fact that i had to use 18f4520 or 18f4550 and the code compiled successfully and there was not a single error from the mikroc pro compiler. but the problem is by the time i try to simulate with proteus i get a load of stack error and error from uninitialized memory location. The fact is that i have been able to narrow the error to problem of using the sprintf and the division and multiplication function in the codes. And i feel the compiler is not dealing with IRP bit properly in its working with floating point.So fact from all i have been doing is that floating point operation in mikroc pro is not yet sure proof to work, cause most time with the same routine and another c compiler i get my code to work perfect. I was wondering if anyone has suggestions on using sprintf and other mathematical functions involving floating point. Or i will want to have links to other users function that implement sprintf and floating points maths routine without the hassles generated by stack errors. i would love to stay with mikroc pro cos its so easy to use. thanks for stopping by. :(

Re: New GLCD project for 18F2550

Posted: 27 Jul 2010 17:04
by tihomir.losic
Hello,

on following link, you can find out more about Sprintf library:
http://www.mikroe.com/esupport/index.ph ... icleid=123
The mikroC PRO for PIC provides a set of standard ANSI C library functions for floating point math handling.
ANSI C Math library:
http://www.mikroe.com/esupport/index.ph ... icleid=117

If this doesn't help you, and error still appears, please, create your ticket on our Support desk on:
http://www.mikroe.com/esupport and send me your complete project for your GLCD.
I need it, in order to continue private investigation, and find solution for your error.

Best regards,

Losic Tihomir

Re: New GLCD project for 18F2550

Posted: 28 Jul 2010 03:39
by inspirational4real
I am uploading the project files and the simulation results so everyone can see what i am talking about. I have tried to simulate by creating a 16 by 2 lcd project before with sprintf function and i get similar complains too.

Re: New GLCD project for 18F2550

Posted: 30 Jul 2010 04:20
by inspirational4real
Any help yet for this post, I have uploaded the schematics and the associated proteus file for simulation purpose, so you can understand what i am talking about as i dont want to go on to design this project on hardware only for it not to work. :?

Re: New GLCD project for 18F2550

Posted: 30 Jul 2010 17:37
by Bonca
Hi!
I can't open your Proteus file because of version problem. Could you upload your schematic as picture?

Bonca

Re: New GLCD project for 18F2550

Posted: 01 Aug 2010 22:22
by inspirational4real
this is the proteus file in compatibility mode and you can check it now, in the mean time i have requested a support ticket with mikroe. I have noticed that while the sprintf function leads to uninitialized memory complain in proteus, using strncpy leads to stack overflow causing a reset in proteus.

Re: New GLCD project for 18F2550

Posted: 03 Aug 2010 06:57
by Bonca
Hi,
here is the result of the simulation.
Clipboard01.jpg
Clipboard01.jpg (175.76 KiB) Viewed 3059 times
Bonca

Re: New GLCD project for 18F2550

Posted: 03 Aug 2010 22:19
by inspirational4real
That is what i was talking about any way i have already taken a support ticket with mikroe and i am waiting for their reply. In the meantime I had wanted to use strncpy function to avoid using sprinf but i got pic18 stack overflow reset in in proteus. I can just avoid using mikroc compiler while i use other c compiler to solve the problem in the immediate.

Re: New GLCD project for 18F2550

Posted: 04 Aug 2010 06:01
by Bonca
Hi,
before you leave mE compiler, i would have you know that Proteus simulation is not always gives that result you are expecting. I suggest to you that try your application on a real hardware. In many case I met with same situation: Proteus is not able to simulate my application correctly but runs on real hardware perfectly.

Bonca

Re: New GLCD project for 18F2550

Posted: 07 Aug 2010 03:37
by inspirational4real
Thanks to everyone who was interested in reading my post and offering to help. As I earlier mentioned I requested a support ticket with mE and they responded to my query(very impressed). This was the summary of the reply.
"
Hello,

I have tested your program on real hardware.
Specifically, I used EasyPIC6 development board (PIC18F4520), and the program has worked without errors.
This leads to the conclusion that the error is in Proteus, your simulator.

Proteus is really not supported mikroElektronika certified environment on which your test can be performed.
So, this is out of our support scope.

Try this on real hardware, it's very very good project.

Thank you for your understanding.
"
I think i am very impressed with the support so far and i will remain loyal to mikroc pro, but again I will like to see it being certified to work with proteus and probably together we make this compiler the best in the world.
Now I will have to get my EasyPIC6 and Easydspic board. Once again thanks everyone for your interest in my post.