New GLCD project for 18F2550

General discussion on mikroC PRO for PIC.
Author
Message
inspirational4real
Posts: 59
Joined: 03 Jun 2009 03:48
Location: benin city, Nigeria

Re: New GLCD project for 18F2550

#16 Post by inspirational4real » 27 Jul 2010 04:46

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. :(

User avatar
tihomir.losic
mikroElektronika team
Posts: 2138
Joined: 02 Dec 2009 14:16
Location: Serbia
Contact:

Re: New GLCD project for 18F2550

#17 Post by tihomir.losic » 27 Jul 2010 17:04

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
mikroElektronika [Support team]

inspirational4real
Posts: 59
Joined: 03 Jun 2009 03:48
Location: benin city, Nigeria

Re: New GLCD project for 18F2550

#18 Post by inspirational4real » 28 Jul 2010 03:39

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.
Attachments
sprintf.rar
complete project file with simulation result
(111.35 KiB) Downloaded 157 times

inspirational4real
Posts: 59
Joined: 03 Jun 2009 03:48
Location: benin city, Nigeria

Re: New GLCD project for 18F2550

#19 Post by inspirational4real » 30 Jul 2010 04:20

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. :?

Bonca
Posts: 319
Joined: 18 Mar 2009 07:55

Re: New GLCD project for 18F2550

#20 Post by Bonca » 30 Jul 2010 17:37

Hi!
I can't open your Proteus file because of version problem. Could you upload your schematic as picture?

Bonca

inspirational4real
Posts: 59
Joined: 03 Jun 2009 03:48
Location: benin city, Nigeria

Re: New GLCD project for 18F2550

#21 Post by inspirational4real » 01 Aug 2010 22:22

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.
Attachments
sprintf.rar
(125.44 KiB) Downloaded 150 times

Bonca
Posts: 319
Joined: 18 Mar 2009 07:55

Re: New GLCD project for 18F2550

#22 Post by Bonca » 03 Aug 2010 06:57

Hi,
here is the result of the simulation.
Clipboard01.jpg
Clipboard01.jpg (175.76 KiB) Viewed 2961 times
Bonca

inspirational4real
Posts: 59
Joined: 03 Jun 2009 03:48
Location: benin city, Nigeria

Re: New GLCD project for 18F2550

#23 Post by inspirational4real » 03 Aug 2010 22:19

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.

Bonca
Posts: 319
Joined: 18 Mar 2009 07:55

Re: New GLCD project for 18F2550

#24 Post by Bonca » 04 Aug 2010 06:01

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

inspirational4real
Posts: 59
Joined: 03 Jun 2009 03:48
Location: benin city, Nigeria

Re: New GLCD project for 18F2550

#25 Post by inspirational4real » 07 Aug 2010 03:37

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.

Post Reply

Return to “mikroC PRO for PIC General”