It is currently 20 Oct 2018 09:52

All times are UTC + 1 hour




Post new topic Reply to topic  [ 75 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
PostPosted: 29 Sep 2009 16:58 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
The replacement libs are being updated continually and there's a web page about them (among other things). Please look for news there or at Libstock.
_____________________________________________________________________
For the incoming version 3.00 of mP PRO I've prepared some refreshed and some new replacement libraries:

- Strings library (__Lib_String)
- Conversions library (__Lib_Conversions)
- Floating-point math library (__Lib_MathDouble - two versions)
- internal EEPROM library (__Lib_EEPROM_256 and __Lib_EEPROM_1024)
- System library (__Lib_System)


These are all precompiled libs replacing official ones with the advantage of smaller and faster code for routines present in official libs, and many additional routines that should simplify programming and make it more :wink: Pascal/Delphi-like. Hope you'll like them :) .

In the Conversions lib replacement some routines perform similar task - that's because new routines work differently than those from official lib (in fact, the latter call the former and only then change the result). The official lib routines are there both for compatibility with older code and for other official libs that use them.

The Strings library has been expanded with new Delphi-like routines. For those that use Florin's Ethernet libs a small library was added that should be used instead of his Additional Strings Library (which cannot be used in parallel with the Conversions lib replacement). It contains just few routines that differ in naming from the Strings lib replacement and are needed by Ethernet libs. It's naturally called the same: pic_additional_string_library.mcl

Floating-point math library replacement has two versions - both produce smaller code than the official one and give more accurate calculation results by fixing problems that the official lib inherited from the original Microchip library, i.e.
- lack of 'unbiased' rounding,
- lack of rounding while converting to integer types,
- lack of big numbers 'rounding', i.e. conversion error reduction,
- max negative number reported as integer overflow,
- overflow not reported for division by zero (result=dividend),
– no protection against numbers with EXP=0 and significand<>0 that do not belong to Microchip format.

Both versions give access to floating-point operations' status byte. One of them may generate 'exceptions', i.e. allows to write code that contains provisions for calculation errors (like overflow, underflow, or division by zero).
There is also an additional lib, called FPmath, containing some useful routines. Some of them are replacements of official ones that either won't work properly with the new lib, or are less optimised. There are also conversion routines, between Microchip and IEEE 754 formats.

Internal EEPROM libraries contain some additional routines for block read/write.

The System lib replacement is aimed at demanding applications and for use by a bit more advanced programmers. Besides some marginal optimisation, the main change introduced concerns only indirect function calls, i.e. calls made using pointers. The original library uses Top Of Stack registers in such cases – which in turn requires blocking of interrupts for several assembly instructions. If this is undesirable, indirect function calls may be performed using PCLAT rather than TOS - and without the need to block interrupts.

Every lib has a description in pdf format (cost me some time and determination to write them, so please do be merciful in criticising them :wink: ).

Archived file with all replacement libs may be accessed here: http://www.cobir.com/mPPROrepl.rar.

Please remember to save the official libs, or rename them before placing the replacement libs in the .../Uses/P18 directory.

About later updates read here and here.


Last edited by janni on 05 Apr 2018 13:30, edited 13 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: 01 Oct 2009 19:58 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
Thanks! :D :D

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 11:01 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
Hi Janni,

When I use the new "Conversions" and the modified "pic_additional_string_library" then my ethernet applications do not work any more: There is no more incoming data in routine "Eth_UserUDP" (I use your ENC libraries).

Thanks in advance! :D

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 14:13 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
Erratum :oops: : I use the ENC libraries of Florin.

Dany wrote:
(I use your ENC libraries).

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 15:06 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
I'm sure everybody knows who's the author of the ENC libs :) . Back to the problem - maybe Florin introduced some changes in his library. My version of pic_additional_string_library contains folowing routines

procedure Mem_Set(pt:word; ch:char; n: word);

function Mem_Cmp(pt1,pt2:word; n: word): byte;

procedure Mem_Cpy(pt1,pt2:word; n: word);

procedure Str_Cut_Left(var str_: string[$FFF]; n: word);

which previously worked. We will have to wait for Florin to enlighten us about any changes in, naturally :wink: , his libs.


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 16:44 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
Thanks Janni.

I assume the reason for the problem can, besides in the adapted "pic addtional string library", also be in the new "Conversions" lib, as I understand that a lot of routines previously present in "pic addtional string library" are moved (and perhaps redesigned?) to the new "Conversions"?

Thanks in advance! :D

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 17:17 
Offline

Joined: 19 Sep 2006 12:57
Posts: 1868
Location: Romania, Arad City
hmmm,

I don't change anything in ETH library.

Dany, can you tell me if with old replacement library works ?

PS: I update my additional libraries. New version of SDMMC_SPI library available.

_________________
Best regards, Florin Andrei Medrea.

http://www.microelemente.ro/
http://www.microelemente.ro/produse-si-servicii/
http://www.microelemente.ro/custom-software/

mail : florin@microelemente.ro


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 17:36 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Danny wrote:
as I understand that a lot of routines previously present in "pic addtional string library" are moved (and perhaps redesigned?) to the new "Conversions"?

No, no routines previously present in my version of "pic addtional string library" were moved to Conversions lib (only routines, previously present in conversions2 lib, were moved to Conversions). I'll re-check if there are any discrepancies between Florin's routines and mine from Conversions and String libs that could lead to problems.

yo2lio wrote:
I don't change anything in ETH library.

Danny previously used the 3.5 version of the ENC libs and it did work with my older replacement libs. If you also didn't make any changes to the pic_addtional_string_library then I'll have to look for them in my libs...


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 19:53 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
janni wrote:
Danny previously used the 3.5 version of the ENC libs and it did work with my older replacement libs. If you also didn't make any changes to the pic_addtional_string_library then I'll have to look for them in my libs...
I still do use this version of the ENC libs.
The only replacement lib I used in the past was the String lib.
I tried to use the previous Conversion lib replacement together with the previous replacement version of Pic additional strings, but then I got some wierd linking errors, so that combination did not work.

With the appearance of the replacement libs suited for mP v3.00 I tried again to use them, with the known result.

So, at this moment I can use all replacement libs, except for the Conversions lib, together with the yo2lio's original Pic additional string library. ETH works flawless.

Using the new Conversions library with the adapted Pic additional strings lib gives me the ETH problem.

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 02 Oct 2009 22:29 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Dany wrote:
I tried to use the previous Conversion lib replacement together with the previous replacement version of Pic additional strings, but then I got some wierd linking errors, so that combination did not work.
O.K. I've got the impression that both libs worked with the Ethernet libs or I would have tried to find a solution. Anyway, after communication with Florin (thanks again for quick response, Florin :) ), I think I know where the incompatibilities lay - there will surely be a way to solve this issue soon :) .


Top
 Profile  
 
 Post subject:
PostPosted: 03 Oct 2009 02:51 
Offline

Joined: 28 Dec 2005 16:42
Posts: 1379
Location: Laval,Québec,Canada,Earth... :-)
hi gang,

Maybe nobody do it in the past but like many user of this forum, i use one (or many) of your lib or work... So i want to thank's you for all your good and nice work with MP ...

Thank Janni !
Thank Yo2lio !
Thank Dany !

you keep this forum alive and push Me do to a better compiler ;-)

its my 2 cents )))


Top
 Profile  
 
 Post subject:
PostPosted: 06 Oct 2009 10:31 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
Hi Janni,

Is the call to "SaveAll" in main and interrupt necessary when using your libraries? see http://www.mikroe.com/forum/viewtopic.php?t=19970&start=21

Thanks in advance! :D

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 06 Oct 2009 11:58 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Thanks to Florin's and Dany's help, the incompatibility problems of Conversions lib with Florin's Ethernet libs have been solved :) . The libs have been updated.

Dany wrote:
Is the call to "SaveAll" in main and interrupt necessary when using your libraries?
It's not always necessary, but it's better to do it. As Florin explained, with no explicit use of FSRs (in Pascal) in interrupt service routines, it's not needed. If one uses FSRs in Pascal code placed in ISRs (or calls routines that do it), it's better to call SaveAll both in ISR and main code.

Although I use much more assembly than Florin in his additional string lib, there are still many routines that use assignments to FSRs in Pascal. (This will be changed, if mE won't fix in v 3.00 release the problem with context saving for FSRs used in Pascal . Even so, it'll still be necessary sometimes to call SaveAll in ISRs, I'm affraid.)


Top
 Profile  
 
 Post subject:
PostPosted: 28 Oct 2009 11:28 
Offline

Joined: 18 Jun 2008 11:43
Posts: 3764
Location: Nieuwpoort, Belgium
Hi Janni,

I did set (accidently) the "BuildType" to "ICD Debug" and, when compiling, I got the error "error: 0 340 File 'C:\Program Files\Mikroelektronika\mikroPascal PRO for PIC\uses\P18\__Lib_String.mpas' not found" for all your replacement libraries I used. The error disappeared when I place the original libraries mE in 'uses\P18'.
This is only for your information, I do not need the ICD build type possibility.

But: your libraries are superb! Thanks :D

_________________
Kind regards, Dany.
There is a crack in everything, that's how the light gets in... (L. Cohen)


Top
 Profile  
 
 Post subject:
PostPosted: 28 Oct 2009 16:30 
Offline

Joined: 18 Feb 2006 13:17
Posts: 4983
Yes, indeed :( . Apparently it's required to compile libs with ICD Debug, not Release option checked.

Newly compiled libs are available now (it appears that v 3.20 produces larger mcl files than the pre-release version, but it doesn't seem to be caused by larger final code).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 75 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: