Clock speed constant

Post your requests and ideas on the future development of mikroC for dsPIC30/33 and PIC24.
Post Reply
Author
Message
Daniel Wee
Posts: 38
Joined: 14 Jun 2007 22:05

Clock speed constant

#1 Post by Daniel Wee » 12 Feb 2009 20:40

I have noticed that while you can define the clock speed down to the last Hz, the internal variable doesn't seem to make use of this extra resolution - for example in the calculation of baudrates.

Right now declaring 80.000010MHz and 80.000000MHz will have absolutely no difference in the computations.

Is it possible to store the full resolution that is defined so that our own timing routines can refer to it with better accuracy?

Daniel

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

Re: Clock speed constant

#2 Post by milan » 16 Feb 2009 10:20

Hi,
Daniel Wee wrote:for example in the calculation of baudrates.
Right now declaring 80.000010MHz and 80.000000MHz will have absolutely no difference in the computations.
Baudrate calculation ends with rounding, result must be written in register so it has to be an integer.
It is possible that you can't see the difference because of rounding, give us the calculation example ...
SmartADAPT2 rules !

Daniel Wee
Posts: 38
Joined: 14 Jun 2007 22:05

#3 Post by Daniel Wee » 16 Feb 2009 17:10

I remember once when I wanted to reference clock constant, and found that it did not preserve the full resolution so in the end I had to define my own constant. If you really need it, I can try to find an example.

Daniel

User avatar
milan
mikroElektronika team
Posts: 1013
Joined: 04 May 2006 16:36
Contact:

#4 Post by milan » 17 Feb 2009 10:03

Hi,

please try to find an example so we can examine the problem
SmartADAPT2 rules !

Post Reply

Return to “mikroC for dsPIC30/33 and PIC24 Wish List”