Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 29, 2024, 05:00:54 17:00


Login with username, password and session length


Pages: [1]
Print
Author Topic: Omniscient for Hi-Tech  (Read 3194 times)
0 Members and 1 Guest are viewing this topic.
makall
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 6
-Receive: 3


« on: January 12, 2008, 11:33:45 11:33 »

Hi everybody!

At this days I'm reading about the omniscient for hi-tech. It remove don't used functions and variables,    
optimizes the code, etc. But the CCS do same thing for years.

These are my questions: The resulted code is realy better than CCS? There is some good reason to I port my CCS code to PICC?

I know, some tests can be done, like a Hello World, but it is not enough to realy test a compiler. I think these questions can be answered for somebody that was ported a real aplication.

For now I'm doing my tests and I will post any news.

Tks and bye!
Logged
tavioman
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 14
-Receive: 17



« Reply #1 on: January 12, 2008, 04:14:51 16:14 »

Well... I'm glad you ask this.
I have been using CCS for 2 years till now. I have made a big project on PIC18F452 and the memory was virtually full. I have made some debug things with printf since I don't like debugging on PIC with any debugger. The code was huge abut 98% of flash was full. After this I had to make a 2nd version of the project with more features on it. There ware still room on the PIC if I removed debugging stuff(printf).
I decided to switch the compiler since I really need a trust worthy one with a small list of bugs. I have moved the project to HiTech-C standard version without OCG.
I was suprised that after first compilation with all the debug stuff flash was about 48% full. I have added tons of new features and the flash is now 72%. So you see CCS 98% - HiTech 48%. It's a big difference....
I had to implement myself several functions that normally were "built-in" in CCS... like "SysSpiWrite", "SysSpiRead", "SysEepromRead", etc...
Best regards...
Logged

- Brain juice -
makall
Inactive

Offline Offline

Posts: 6

Thank You
-Given: 6
-Receive: 3


« Reply #2 on: January 12, 2008, 05:01:14 17:01 »

Wouh! a half of memory?! I'm surprised.

Made your own library is good because you can do it to your needs without spend a lot of memory with things that you never will use!
Logged
tavioman
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 14
-Receive: 17



« Reply #3 on: January 12, 2008, 05:04:49 17:04 »

Yes, and it's not hard at all. Simple functions...
eg:
Code:
UNSIGNED_8 SysSpiReadByte(void)
{
SSPBUF = 0x00; // initiate bus cycle
while(!BF) // wait until cycle complete
{
}
return(SSPBUF); // return with byte read
}
You can find all over the WWW functions like this...
Logged

- Brain juice -
mitsos
Hero Member
*****
Offline Offline

Posts: 845

Thank You
-Given: 3009
-Receive: 4338


« Reply #4 on: January 13, 2008, 01:38:32 01:38 »

Hi tavioman

did you try the version 9.61 pro to to see the extra size reduction? (as Hitech claims)

regards
mitsos
Logged
tavioman
Active Member
***
Offline Offline

Posts: 151

Thank You
-Given: 14
-Receive: 17



« Reply #5 on: January 13, 2008, 07:21:38 07:21 »

No,I have not tried yet. I see that there are a lot of bugs in that version...

Posted on: 2008-01-13, 08:00:41 - Automerged

I suggest to all of you to start using HiTech....
Good thing is that they have in their MCU header files all registers defined.
There are also a lot of useful macros(WRITETIMER0, WRITETIMER1, eeprom_write, etc...).
And if ever need any function that you used to have it in CCS as "built-in" you can always use the functions that are in Microchip MPLAB C18 to make your own HiTech functions... it's very simple, you can also use some CCS functions in the "drivers" directory:
eg:
Code:
#define SysEepromWrite8	eeprom_write // eeprom_write is a HiTech macro that writes a byte to EEPROM

void SysEepromWrite16(UNSIGNED_8 address, UNSIGNED_16 data)
{
UNSIGNED_8 i;

for(i = 0; i < 2; ++i)
{
SysEepromWrite8(address + i, *((UNSIGNED_8 *)(&data) + i));
}
}

UNSIGNED_16 SysEepromRead16(UNSIGNED_8 address)
{
   UNSIGNED_8  i;
   static UNSIGNED_16 near data;

   for(i = 0; i < 2; ++i)
   {
     *((UNSIGNED_8 *)(&data) + i) = SysEepromRead8(address + i);
   }
   return(data);
}

Now you have this helpful functions in HiTech...
cheers to all
Logged

- Brain juice -
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC