The Puma
Guest
|
|
« on: March 19, 2007, 04:11:42 16:11 » |
|
Can someone upload the latest version please
|
|
|
Logged
|
|
|
|
ducky2002
Guest
|
|
« Reply #1 on: March 19, 2007, 04:55:55 16:55 » |
|
what are your requests for? to increase your postmeter? if somebody has the newest version and if the version is worth to it will be posted.
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #2 on: March 19, 2007, 10:22:43 22:22 » |
|
I also request that version & I also wonder why people reply to topics without any useful information? To increase their postmeter perhaps?
Regards...
|
|
|
Logged
|
Regards...
|
|
|
Soter
Junior Member
Offline
Posts: 64
Thank You
-Given: 24
-Receive: 13
|
|
« Reply #3 on: March 20, 2007, 02:02:28 02:02 » |
|
what are your requests for? to increase your postmeter? if somebody has the newest version and if the version is worth to it will be posted.
it bothers to you? You work for CCS or gives you envies that if we know to use it and your no?
|
|
|
Logged
|
|
|
|
robban
Senior Member
Offline
Posts: 265
Thank You
-Given: 34
-Receive: 38
Warrior
|
|
« Reply #4 on: March 21, 2007, 04:40:47 16:40 » |
|
Hi! Since CCs is flooding the market with a neverending stream of releases, it would be nice if You all took the time to find out what really is new or inventive with each release. Myself I compare the examples folder(cut, paste and watch!). We all know how to arrange and compile our code. A new GUI doesn't make a summer. The fact that new releases just try to fix bugs in the predecessors doesn't make it a good compiler...
|
|
|
Logged
|
Code Warrior
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #5 on: March 22, 2007, 12:40:12 00:40 » |
|
I mainly wait for the linker to function in fact. But sure I'll try to get away with that compiler for pic18 & above if I find an alternative because of the library management of CCS!
Regards...
|
|
|
Logged
|
Regards...
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #6 on: March 22, 2007, 07:06:49 19:06 » |
|
Sincerely, The price difference between 18Fxx series and 16Fxx series is negligible, and in some cases 18Fxx series are cheaper than 16Fxxx... and for every 16Fxx we can have an equivalent in 18Fxx with 3 or 4 more flash, more memory, more peripherals, autoflash feature... and for the 18Fxx series microchip give the Student version of its very nice compiler with less bug than CCS. Why stick with 16Fxx series? Microchip compiler even in commercial version is not so expensive (compares to CCS PCHW) ... and for very little PICs like 10Fxx and 12Fxx sincerly there is practically no compiler that is really usable for this low end series, so why stick with the ugly CCS compiler? PIC18 compiler from microchip is free (in student edition), the optimisation is disabled after 60 days, but can be reactivated by simply uninstalling it and reinstalling it (and go for 60 other days)... it has good libraries (LCD, I2C and SPI in soft and hardware, ...), very good integration in MPLab and it's simulator ... very good lib handling (linker)... I think that instead of losing time to wait for every version of CCS, the best is spend more time to learn C18 Compiler from Microchip, and even to port the drivers from CCS to C18 from Microchip. It can be a better time investment... And I finally think that the best we can do in this forum, instead of stoling compilers, is to launch a new open source project based on C18 in order to create every kind of libs to make C18 easy to use for begginers. It will be a very profitable experience.
Best regards
PS. I do not work for any compiler company. It's just my own opinion.
|
|
« Last Edit: March 22, 2007, 10:59:10 22:59 by bluex »
|
Logged
|
|
|
|
tavioman
Active Member
Offline
Posts: 151
Thank You
-Given: 14
-Receive: 17
|
|
« Reply #7 on: March 22, 2007, 07:28:42 19:28 » |
|
That's a very pertinent opinion. People can also find links to download HiTech's compilers, that are also very good tool for developing embedded software.
|
|
|
Logged
|
- Brain juice -
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #8 on: March 22, 2007, 09:02:05 21:02 » |
|
I also like to go for the C18 compiler but the benchmarks I see on the net makes me believe that C18 generates lots of code comparing to others and if someone has a good comparision between C18 & other compilers please post the link! IAR is not an option for me because they make compilers for nearly every MCU so I think they specialize in non of them. Also their compilers doesn't support inline assembly. And also Hi-Tech is not an option for me. It can be a good compiler but it doesn't have any MCU specific libraries. In the end I don't need the ANSI standart when coding timing routines, I need the timing routines themselves! Anyway I really want to believe that C18 is a good compiler but I need evidence! Then I can look ahead the buggy CCS.
Regards...
|
|
|
Logged
|
Regards...
|
|
|
dobova
Guest
|
|
« Reply #9 on: March 22, 2007, 09:39:16 21:39 » |
|
Sincerely, The price difference between 18Fxx series and 16Fxx series is negligible, and in some cases 18Fxx series are cheaper than 16Fxxx... and for every 16Fxx we can have an equivalent in 18Fxx with 3 or 4 more flash, more memory, more peripherals, autoflash feature... and for the 18Fxx series microchip give the Student version of its very nice compiler with less bug than CCS. Why stick with 16Fxx series? Microchip compiler even in commercial version is not so expensive (compares to CCS PCHW) ... and for very little PICs like 10Fxx and 12Fxx sincerly there is practically no compiler that is really usable for this low end series, so why stick with the ugly CCS compiler?
I quote totally. Except for small 16F like 88 or 628, I've completely switched to 18F. I've used C18 since a couple of year and I found it good and complete. I use also MikroC and MikroBasic for prototyping, and they are also good. CCS ver.3 was very good, but not much experience on ver 4. I used CCS only in MPLAB environment becouse I can't stand CCS editor. Ciao D
|
|
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #10 on: March 22, 2007, 09:58:12 21:58 » |
|
For 18 pin version, 16F84 and 16F62x I switched to 18F1320 ... better with all the advantages I mentioned... and I buy them from Microchip Direct web site at only 2.16Euro for the LF version ... so I do never get back to the ugly 16Fxx series.
|
|
|
Logged
|
|
|
|
makall
Guest
|
|
« Reply #11 on: March 24, 2007, 07:20:37 19:20 » |
|
O guys,
but... what u tell me about Orphaned (un-used) Functions? The CCS remove this functions, do C18 it too?
If a make a library with a lot of functions an put it in my program, and a use in my program only one those functions, will be the othes functions in pic memory too?
How C18 work with it?
Sorry about my English.
|
|
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #12 on: March 25, 2007, 09:46:16 09:46 » |
|
PIC18 linker handles this functionnality. This is why the librarian is useful. In PIC18 C you can create specialised libraries, compile them and use them when you want. The linker will remove all unused functions from your final Hex. And it's the lack of linker and BUGS in CCS that let me ingnore its existance.
Best regards
|
|
|
Logged
|
|
|
|
GreenGiant
Junior Member
Offline
Posts: 38
Thank You
-Given: 2
-Receive: 1
|
|
« Reply #13 on: March 25, 2007, 11:52:01 11:52 » |
|
While this topic is going off topic, my two cents. In prototype or small runs, the cost of an item is not a big deal, thus 18F's are great. But when your making 10,000 units, 50 cents per unit, amounts to alot of money. Im sure most of you wont be making even 1/10th of that many units, but its a point as to why not everyone will use/needs to use the 18F's. (and off course if your using CCS commercially, you should buy it) I love the USB stuff in the 18F's
|
|
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #14 on: March 25, 2007, 12:24:30 12:24 » |
|
While this topic is going off topic, my two cents. In prototype or small runs, the cost of an item is not a big deal, thus 18F's are great. But when your making 10,000 units, 50 cents per unit, amounts to alot of money. Im sure most of you wont be making even 1/10th of that many units, but its a point as to why not everyone will use/needs to use the 18F's. (and off course if your using CCS commercially, you should buy it) I love the USB stuff in the 18F's
Sorry but most of the PIC18 parts are cheaper than 16Fxx series equivalent because of the new fabrication processes used by Microchip. The only exception is maybe the 16F88 and the 16F57 (that replaces the 16C57 -- 12 bits core), or the new low end 10Fxx series that have no equivalent but for witch no compiler is really useful.
|
|
|
Logged
|
|
|
|
Robi
Newbie
Offline
Posts: 20
Thank You
-Given: 54
-Receive: 1
|
|
« Reply #15 on: March 25, 2007, 05:21:53 17:21 » |
|
Whether the PIC18 parts are cheaps or not what of the funny news this thread only has is the request in itself: PCWH 4.030 ?! and where the heck this version did come from ? Does the original poster know something we don't ? The link http://www.ccsinfo.com/devices.php?page=versioninfo tags the 4.025 as the current version, so it's exactly this one that we would like to see on here !
|
|
|
Logged
|
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #16 on: March 25, 2007, 07:15:39 19:15 » |
|
Can someone upload the latest version please
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #17 on: March 25, 2007, 11:54:41 23:54 » |
|
The information at this link is faulty. They probably screwed up the version page. The lastest version was 4.030 by a couple of days ago and it is used by users of CCS. Check their forum in case you're not sure! Regards...
|
|
|
Logged
|
Regards...
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #18 on: March 26, 2007, 04:19:09 16:19 » |
|
Can someone upload the latest version please
|
|
|
Logged
|
|
|
|
FriskyFerret
Hero Member
Offline
Posts: 560
Thank You
-Given: 513
-Receive: 360
Put it in, take it out.
|
|
« Reply #19 on: March 26, 2007, 11:29:45 23:29 » |
|
Can someone upload the latest version please. You went to every recent thread about the CCS compiler and posted this message. Are you 8 years old or something? Give it a rest, eh?
|
|
|
Logged
|
Dancing pants and leotards, that's what I'm talkin' about!
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #20 on: March 27, 2007, 02:21:50 14:21 » |
|
4.024 A problem with the floating point unary minus operator on some chips is now fixed 4.024 The IDE now includes an option to use clasic menus instead of the new ribbons 4.025 Updates made for the newest chips 4.026 A code optimization bug has been fixed 4.026 Problems with reading and writting to flash on some parts is fixed 4.026 Experimental code completion added to the IDE (defaults to off for now) 4.027 Removed an IDE query after compilation concerning file reloads 4.028 A run time error in CCSC for some users is fixed 4.029 An optimization problem dealing with bit arrays is fixed 4.029 Some issues with write_program_memory erasing too much or not enough are fixed 4.029 Updates made for the newest chips 4.030 Some IDE editor problems have been fixed
|
|
|
Logged
|
|
|
|
FriskyFerret
Hero Member
Offline
Posts: 560
Thank You
-Given: 513
-Receive: 360
Put it in, take it out.
|
|
« Reply #21 on: March 28, 2007, 02:44:34 14:44 » |
|
Are you going to beg every two weeks for the rest of the year when a new version of CCS is released?
|
|
|
Logged
|
Dancing pants and leotards, that's what I'm talkin' about!
|
|
|
tavioman
Active Member
Offline
Posts: 151
Thank You
-Given: 14
-Receive: 17
|
|
« Reply #22 on: March 28, 2007, 02:50:10 14:50 » |
|
|
|
|
Logged
|
- Brain juice -
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #23 on: March 28, 2007, 03:21:40 15:21 » |
|
|
|
|
Logged
|
|
|
|
kcid
Guest
|
|
« Reply #24 on: March 28, 2007, 05:13:15 17:13 » |
|
Please we're waiting for this....
|
|
|
Logged
|
|
|
|
Soter
Junior Member
Offline
Posts: 64
Thank You
-Given: 24
-Receive: 13
|
|
« Reply #25 on: March 29, 2007, 10:53:36 22:53 » |
|
Are you going to beg every two weeks for the rest of the year when a new version of CCS is released? Upload please!!!
|
|
« Last Edit: March 29, 2007, 11:07:17 23:07 by Soter »
|
Logged
|
|
|
|
RedAlert
Active Member
Offline
Posts: 161
Thank You
-Given: 168
-Receive: 302
|
|
« Reply #26 on: March 29, 2007, 11:11:40 23:11 » |
|
It won't help you, if u continue begging for latest version; If no-one has it, it cannot be shared. I really don't know what you find in this buggy compiler, switch to better one as HT-SOFT...
|
|
|
Logged
|
"Life would be easier if we had its source code"
|
|
|
vmax
Newbie
Offline
Posts: 11
Thank You
-Given: 7
-Receive: 0
|
|
« Reply #27 on: March 30, 2007, 03:12:31 15:12 » |
|
RedAlert,
I can understand the reason that some guys are asking for the last version of CCS.
Several ones have a lot of already done codes made in CCS compilers. Some times these codes became part of a "library".
I agree with you that this compiler is full of bugs. What the guys at CCS thinks that is a good marketing plan releasing patches twice a month, I see that as a very buggy product...
But, I already developed several codes in CCS and when someone ask me to develop a code ASAP for small college projects, I use it.
Anyway, I want to post here a small suggestion: Use another compiler as HT-SOFT (as told by RedAlert), and reserve some time to update your libraries to this new software. This is a worthwhile job!
VMAX
|
|
|
Logged
|
|
|
|
FriskyFerret
Hero Member
Offline
Posts: 560
Thank You
-Given: 513
-Receive: 360
Put it in, take it out.
|
|
« Reply #28 on: March 30, 2007, 06:59:38 18:59 » |
|
Just so I'm being clear. I think the CCS v3.249 compiler is a very good compiler for the average user. Combined with their ICD, it's great. (Its what I use.) It's just that the new v4 will be seriously buggy for at least most of the rest of 2007 until the idiots at CCS make all their customers do the testing work. My employer has a CCS support agreement so I can download the most recent version whenever I want, but I don't and won't because its still crap.
Use v3.249!
|
|
|
Logged
|
Dancing pants and leotards, that's what I'm talkin' about!
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #29 on: March 30, 2007, 10:48:35 22:48 » |
|
Anyway, I want to post here a small suggestion: Use another compiler as HT-SOFT (as told by RedAlert), and reserve some time to update your libraries to this new software. This is a worthwhile job!
VMAX Woow something we didn't think of. I really like to see & have the CCS delay library for variable clock frequency updated for HT-SOFT compiler as just a start to updating libraries for HT-SOFT. Maybe GOD may have one! Regards...
|
|
|
Logged
|
Regards...
|
|
|
vmax
Newbie
Offline
Posts: 11
Thank You
-Given: 7
-Receive: 0
|
|
« Reply #30 on: March 31, 2007, 03:29:38 15:29 » |
|
Hey, Hate!
This is a realy good idea!!!
Maybe we can start a task force in order to study how we could do that!
DonĀ“t forget that are a few really good programmers among us that could undestand the assembly behind the delay code and implement a new external function/procedure to do that!!!
Anyway, the delay routine in CCS needs the declaration #use delay, as a parameter to all calculations...
Ok, ok, this is not exactly what you said, but, it is a start, donĀ“t you think?
What do you think about create this kind of task force?
VMAX
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #31 on: April 01, 2007, 12:20:58 00:20 » |
|
You still insist on NOT to understand, to make 'delay' routines with variable frequency you have to EMBED it into the compiler NOT into a library! This is not a matter of assembler or C, this is a matter of being ANSI C(not MCU specific) or not being ANSI C(MCU specific)! I really hate this part of CCS, no library manegment but that's the most precious part of it, BEING MCU SPECIFIC! If you think you can make that library or modify the hitech compiler for it, I like to see it. Otherwise please stop thinking that you are the only proffesional!
Regards...
|
|
|
Logged
|
Regards...
|
|
|
tcny4ever
Guest
|
|
« Reply #32 on: April 04, 2007, 02:18:30 02:18 » |
|
I've followed this thread for a bit. Perhaps it would be easier for some folks to just say, "I don't have the latest version." No need to try and convince others that the latest version isn't worthwhile or attempt to induce others to move to another package. If you don't have it, you don't have it. 'Nuff said.
|
|
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #33 on: April 04, 2007, 04:12:20 16:12 » |
|
|
|
« Last Edit: April 04, 2007, 04:19:29 16:19 by bluex »
|
Logged
|
|
|
|
tavioman
Active Member
Offline
Posts: 151
Thank You
-Given: 14
-Receive: 17
|
|
« Reply #34 on: April 04, 2007, 10:16:04 22:16 » |
|
|
|
|
Logged
|
- Brain juice -
|
|
|
pama
Junior Member
Offline
Posts: 74
Thank You
-Given: 10
-Receive: 28
|
|
« Reply #35 on: April 05, 2007, 08:38:40 08:38 » |
|
Bluex, let's allow the people to decide himself wich platform would they like to use. regards
|
|
|
Logged
|
|
|
|
lahoras
Guest
|
|
« Reply #36 on: April 13, 2007, 12:58:38 00:58 » |
|
Bluex, let's allow the people to decide himself wich platform would they like to use.
I think is a good idea, but picc18 or other are not practice, in CCS compiler all is done, I think that request is a good way to debug this great tool, and if you don't like it's very simple don't use it.
|
|
|
Logged
|
|
|
|
GreenGiant
Junior Member
Offline
Posts: 38
Thank You
-Given: 2
-Receive: 1
|
|
« Reply #37 on: April 13, 2007, 08:51:15 08:51 » |
|
Haha... 4.029 Some issues with write_program_memory erasing too much or not enough are fixed No wonder I has having so many issues with that function (and many others)
I always manage to write code that hits a bug yet to be fixed, two weeks ago, it was the floating point math (boom i got caught with it) and then this week its the memory write.
With all these bugs, they should just give out beta versions, crippled if need be, and get feedback and fix the compiler. Seing as their not capable of fixing the bugs themselves, least they can get feedback from users, and users get free use of the buggy software
|
|
« Last Edit: April 13, 2007, 08:56:06 08:56 by GreenGiant »
|
Logged
|
|
|
|
RedAlert
Active Member
Offline
Posts: 161
Thank You
-Given: 168
-Receive: 302
|
|
« Reply #38 on: April 14, 2007, 01:08:44 13:08 » |
|
|
|
|
Logged
|
"Life would be easier if we had its source code"
|
|
|
ORIONIX
Newbie
Offline
Posts: 18
Thank You
-Given: 56
-Receive: 3
|
|
« Reply #39 on: April 14, 2007, 04:02:51 16:02 » |
|
|
|
|
Logged
|
|
|
|
darksky
Junior Member
Offline
Posts: 51
Thank You
-Given: 183
-Receive: 5
|
|
« Reply #40 on: April 14, 2007, 05:55:43 17:55 » |
|
Thanks from me too
|
|
|
Logged
|
|
|
|
consent
Newbie
Offline
Posts: 11
Thank You
-Given: 8
-Receive: 3
|
|
« Reply #41 on: April 14, 2007, 06:38:00 18:38 » |
|
RED ALERT it is giving registration error..do u have any idea???
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #42 on: April 14, 2007, 11:16:44 23:16 » |
|
Thnx for v4.032!
Regards...
|
|
|
Logged
|
Regards...
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #43 on: April 15, 2007, 09:35:37 21:35 » |
|
|
|
|
Logged
|
|
|
|
Dembo
Guest
|
|
« Reply #44 on: April 16, 2007, 09:04:32 09:04 » |
|
To bluex: If You don't love this compiler - why do You enter to the thread about it? Look how many thanks people say to someone who shared it! And if You don't know 3.249 is LAST stable version, but NOT ONLY. As I remember 3.191, 3.157 and many others WERE STABLE. Unlike others CCS releases updates immediately, and not once a year releases patches PL1, PL2 ... I work with this compiler since 1998 and very satisfied. All bugs I have found always were MY bugs and not compiler's. And It doesn't matter for me if there is a some problem or bug when using something exotic like "5-dimension array of pointers to float" - I never had a problem with CCS bugs in my projects.
|
|
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #45 on: April 16, 2007, 09:16:24 09:16 » |
|
To bluex: If You don't love this compiler - why do You enter to the thread about it? Look how many thanks people say to someone who shared it! And if You don't know 3.249 is LAST stable version, but NOT ONLY. As I remember 3.191, 3.157 and many others WERE STABLE. Unlike others CCS releases updates immediately, and not once a year releases patches PL1, PL2 ... I work with this compiler since 1998 and very satisfied. All bugs I have found always were MY bugs and not compiler's. And It doesn't matter for me if there is a some problem or bug when using something exotic like "5-dimension array of pointers to float" - I never had a problem with CCS bugs in my projects.
I only do it for jocking, but I really do not appreciate nor use this ugly compiler. But, If YOU love it so much and you appreciate so much CCS works, why do you not buy it? this will give them more money to enhance their compiler ! Piracy is not a good thing! If it let you appreciate and test correctly a product without limitations, why you do not buy it if it gives you so satisfaction? What I hate in this forum is the fact that most users spend their time waiting for new versions and compilers, but no project has been really built. Some times ago someone proposed to create a FREE OPEN USB programmer because a lot of people wanted to have the firmware of WinPIC800 - GTP+ programmer, but nothing has been done. The post is more than 2 months old if I remember, and in two months, with 4 or 5 developpers, I think that a GTP+ like firmware is not so difficult to create. This is the ugly face of this forum. Sharing is good, but stoling is NOT good! best regards
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #46 on: April 16, 2007, 10:35:51 10:35 » |
|
I only do it for jocking, but I really do not appreciate nor use this ugly compiler. But, If YOU love it so much and you appreciate so much CCS works, why do you not buy it? this will give them more money to enhance their compiler ! Piracy is not a good thing! If it let you appreciate and test correctly a product without limitations, why you do not buy it if it gives you so satisfaction? What I hate in this forum is the fact that most users spend their time waiting for new versions and compilers, but no project has been really built. Some times ago someone proposed to create a FREE OPEN USB programmer because a lot of people wanted to have the firmware of WinPIC800 - GTP+ programmer, but nothing has been done. The post is more than 2 months old if I remember, and in two months, with 4 or 5 developpers, I think that a GTP+ like firmware is not so difficult to create. This is the ugly face of this forum. Sharing is good, but stoling is NOT good!
best regards
The example you give is very weird! If people are in need of a USB Pic programmer there is the USB Brenner posted some time ago, if also a debugger is need then there is the Microchip ICD2 & working great! If someone wants WinPIC800 GTP+ programmer then he/she wants something special & not everyone have to specialise in that nor me! It is really very funny that people think Hi-Tech & IAR are professional compilers. They cannot realise that these two are PIC ports of their original compilers for some other MCU. If you have a doubt have a look at the benchmarks for these compilers especially IAR. They just compile the C code into Assembly and nothing else because they do that for other MCU's they support! Same routines same procedures and not anything special for the MCU! And to those considered with compiler bugs I'd like to see the bugs you found if you had FOUND any? Regards...
|
|
|
Logged
|
Regards...
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #47 on: April 16, 2007, 11:18:27 11:18 » |
|
For the list of bugs in CCS just read this http://www.ccsinfo.com/forum/viewtopic.php?t=27714 this is just some of the problems people found. The bug list at CCS is internal, so bug reports from users are not public. What give me crazy with such compiler is not only bugs but also generated code. Even if you push the optimizations at maximum, a simple code like int i; for (i =110; i<0; i++) doSomething()
Even if the max and min shows clearly that this loop will never execute (and with a MAX and MIN given by int CONSTANTS and not by vars) the compiler generates stupid loop code that will fail at first line !!!! you can try it and see generated asm code !!! Just try a compiler like swordfish basic and you will see that the generated code does not contains such stupid template find/replace code generation algorithms!!! Some times ago I worked for a company that was using CCS and we had lot of problems with floating points. Best of all when I posted such things on CCS forum, my posts where deleted the same day ... and my posts where absolutely not ironic. This the way CCS treat its costumers ! For other compiler I do not agree with you ! For IAR I do not know their compilers. For Hitec C compiler, i used them for a while at a company that develops embedded hardware. We used their 8051 and PIC compilers. The front end of their compilers are the same, and the generated intermediate code is the same, but the back end is absolutely dependent on the target architecture. I used Hitec compiler even with 16C57 witch is a 12bit core (lile 12C508/12C509), and for more than one program when CCS was saying that it need 8 or 10 more ram registers, HITECH generated very compact and clean code. What I can say is that with my 15 years of embedded world and Compiler writing develpper I have never seen a beter and cleaner generated code than Hitec one for 12 and 14 bits cores !!! Best regards
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #48 on: April 16, 2007, 12:22:03 12:22 » |
|
int i; for (i =110; i<0; i++) doSomething()
First of all there is lack of C knowledge here! You didn't complete the for statement with a ';' so this code will give an error of "missing ';' " with CCS. I don't know if other compilers will generate any code but if they do then that's a shame for the compiler! Second 'i' is declared as an 'int'. For CCS 'int' defaults to "unsigned 8-bit integer" which means 'i' will never go negative and the loop will never be executed nor even compiled because the condition is never true neither incremented nor decremented! And that's the lack of your 'compiler defaults' knowledge! Third I know the list of CCS compiler bugs, I had also found some and I participate in their user forum! My question was HAD YOU ever came accross any which means have you used that compiler in detail to find any bug or you just heard it's buggy and don't use it! And last you can be sure about IAR, they don't even support inline assembly because they don't want to be MCU specific in their products I think! Hi-Tech maybe a better compiler in the case they support less MCU's, it could generate less buggy code with comparision to CCS but I prefer faster code instead of less buggy code as I can make ways around the bugs but why do I use a compiler if I will optimize my own code for speed?! Regards...
|
|
|
Logged
|
Regards...
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #49 on: April 16, 2007, 01:23:28 13:23 » |
|
int i; for (i =110; i<0; i++) doSomething()
First of all there is lack of C knowledge here! You didn't complete the for statement with a ';' so this code will give an error of "missing ';' " with CCS. I don't know if other compilers will generate any code but if they do then that's a shame for the compiler! I have more than 19 years experience with C language. My code do not leak anything since it's not a fully working example, it's just a chunck of code. What I means is that CCS compiler will generate asm code that will never be executed because of max and min conditions in loops. you can try it your self. This is ugly. And WE HAVE HAD bugs with floating point and ugly printf function that return a string representation that has nothing to do with the number passed as parameter. For IAR I said that I do not have any experience with their products. For Hitec I do not know if YOU have any knowlege about Compiler writing? I said that the BackEnd is different, and it's the only part that have to be different for an ansi compiler. The front End is practically the same (the only difference is some Pragma and some directives). and this is the way any compiler is written. You just can take a look at FreePascal and how it targets different architectures. The way Hitec compiler deal with different architectures is very well done. The only lack of Hitec compilers is that they do not give for free the number of drivers that CCS gives. But is it so useful to have huge number of libs when the compiler that will compile them will produce erronous code ? CCS is good enough for hobbists but not for production use especially when the target hadrware will deal with peoples security. Now when you said to never had problems with it, I do not speak about compiling programs that are on robots or on hardware that is rebooted 10000 times a day, I'm speaking about firmware that controls harware that will and must stay working for months without any reboot, on programs that do not do only loops and simple tests with 1000 lines of code, but on programs that have more than 400000 lines ... that have to work on devices like 18F8722 ... try doing such projects with CCS and you will see what I mean. Regars !
|
|
« Last Edit: April 16, 2007, 01:29:28 13:29 by bluex »
|
Logged
|
|
|
|
Dembo
Guest
|
|
« Reply #50 on: April 16, 2007, 03:10:12 15:10 » |
|
If YOU love it so much and you appreciate so much CCS works, why do you not buy it? this will give them more money to enhance their compiler ! Piracy is not a good thing! If it let you appreciate and test correctly a product without limitations, why you do not buy it if it gives you so satisfaction? Why do You think that I don't buy it? I have 3 different LEGAL versions of CCSC that I bought, one PCM and 2 PCW. And for commercial projects I use only legal versions. I download new versions from here because CCS demo is limited to specific micro, but I want to "try before buy" how it works on my preferred micro. This lets me to buy it exact when I it really need. I don't use PICbasic, I don't love it, but if someone found it useful - I'll never attack him. You want to prove us that CCSC is bad? For what do You need it? We all are friends here, and if Your friend found girlfriend and love her, You will say him "Your girl is ugly, I recommend You someone better" ? int i; for (i =110; i<0; i++) doSomething() Do You really need such action in You program? What should it do? Or You want to see: what will this stupid compiler do in this case? But if You ask compiler to do something not rational, why do You expect for rational answer?
|
|
« Last Edit: April 16, 2007, 03:35:37 15:35 by Dembo »
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #51 on: April 16, 2007, 03:46:40 15:46 » |
|
Why do You think that I don't buy it? I do not think anything. Everybody is free to do what he wants. I don't use PICbasic
I also do not use it. We all are friends here,
Glad to know that and if Your friend found girlfriend and love her, You will say him "Your girl is ugly, I recommend You someone better" ?
Of course I'll do !!! what happen if he "use" it to produce a baby? it will be bugged ... and when he will become a man, may be he will become a developper at CCS and produces a more buggy compiler version CCS v8.249 . We must preserve the environment from pollution !!!
|
|
« Last Edit: April 16, 2007, 03:48:32 15:48 by bluex »
|
Logged
|
|
|
|
Dembo
Guest
|
|
« Reply #52 on: April 16, 2007, 03:54:29 15:54 » |
|
|
|
|
Logged
|
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #53 on: April 16, 2007, 03:58:17 15:58 » |
|
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #54 on: April 16, 2007, 04:48:47 16:48 » |
|
int i; for (i =110; i<0; i++) doSomething()
First of all there is lack of C knowledge here! You didn't complete the for statement with a ';' so this code will give an error of "missing ';' " with CCS. I don't know if other compilers will generate any code but if they do then that's a shame for the compiler!
I have more than 19 years experience with C language. My code do not leak anything since it's not a fully working example, it's just a chunck of code. What I means is that CCS compiler will generate asm code that will never be executed because of max and min conditions in loops. you can try it your self. This is ugly. And WE HAVE HAD bugs with floating point and ugly printf function that return a string representation that has nothing to do with the number passed as parameter.
Allright I won't go any deeper in this useless discussion but be sure about that the code below doesn't compile to any code if it is in a 'main()' function or not! Because first there is a missing ';' & I guess you have forgotten to type it(according to your 19 year C experience) and second the compiler defaults 'int' to 'UNSIGNED 8-BIT INTEGER' so the expression 'i<0' is NEVER TRUE!!?! Below is a test program check for yourself: void main() { int i;
for (i =110; i<0; i++) delay_cycles(1);
setup_adc_ports(NO_ANALOGS|VSS_VDD); setup_adc(ADC_OFF); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_comparator(NC_NC); setup_vref(FALSE);
// TODO: USER CODE!!
} And the list file: .................... int i; .................... .................... for (i =110; i<0; i++) delay_cycles(1); 0015: MOVLW 6E 0016: MOVWF 26 0017: GOTO 01B //it never checks 'i' jumps directly to init part as 'i' is never negative! 0018: NOP //and this should be the normal compiler behaviour! 0019: INCF 26,F 001A: GOTO 017 And WE HAVE HAD bugs with floating point and ugly printf function that return a string representation that has nothing to do with the number passed as parameter. I always use the printf function and it always supplied my needs without any format problem maybe yours had a special bug for the version you used. Now when you said to never had problems with it, I do not speak about compiling programs that are on robots or on hardware that is rebooted 10000 times a day, I'm speaking about firmware that controls harware that will and must stay working for months without any reboot, on programs that do not do only loops and simple tests with 1000 lines of code, but on programs that have more than 400000 lines ... that have to work on devices like 18F8722 ... try doing such projects with CCS and you will see what I mean. I didn't say I never had problems, in fact I had lots of problems with CCS but I didn't understand where you got the idea that I used it with systems rebooted 1000 times a day? No I haven't used that for human security but I used it for home security with lots of peripherals used in the PIC & the system never goes offline even the main power fails! In theory the code still runs without reboot without a single software related problem so far! I really don't know 400000 lines of code compiles into how many assembly commands but my rough guess is above 400000 if there isn't any definitions in the code and I don't know of a 18 series PIC with memory more than 400kb to try 400000 lines of code you mentioned! Please don't get me wrong 'bluex' your jokes are funny indeed but I can also make jokes about programs that you and others like and that won't make me feel good if that program doesn't deserve this! Regards...
|
|
|
Logged
|
Regards...
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #55 on: April 16, 2007, 06:48:44 18:48 » |
|
What about my last Joke ? you'll find it funny : I really don't know 400000 lines of code compiles into how many assembly commands but my rough guess is above 400000 if there isn't any definitions in the code and I don't know of a 18 series PIC with memory more than 400kb to try 400000 lines of code you mentioned!
wow ... very scientific aproach ... 1- When you have an optimizing compiler, lines are not converted using a template search/replace mechanism (like CCS seems to do )! 2- When you write four lines like Sprintf(....); Sprintf(....); Sprintf(....); Sprintf(....); the code of SprintF is only integrated once (unless you force inlining of intrinsic functions) the lines are replaced by only push of params and call to functions. 3- when I say compiling 400000 that does not mean that ALL the content of the 400000 will be in the final hex !!! lot of libs and functions (not used) will not be integrated, they will be compiled in first stage of compilation and removed in linking/optimizing stage (at least in a good compiler+linker ). Try to have a look at a book on compilation techniques and you'll be less ridiculous in your posts Regards!
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #56 on: April 16, 2007, 08:11:19 20:11 » |
|
I'm not very into compiler writing and don't have any idea about it. I just said "rough guess" as every line of code at least adds a "call subroutine" command if using intrinsic functions as you said. So my rough guess was 400000+ lines of assembly without any "definition,enumaration vs..." in the code. But in case you are adding "libraries, unused functions" in your "400000+ lines of code" then we can consider we are all working with 50000+ lines of code in a simple project! Then that makes not of a big difference 400k with 50k, 1/8 ratio! Regards...
|
|
|
Logged
|
Regards...
|
|
|
Dembo
Guest
|
|
« Reply #57 on: April 16, 2007, 08:45:29 20:45 » |
|
I just opened my current project with all possible stuff: "definitions,enumerations,typedefs,libraries, unused functions etc."...
.lst file is 8000 lines, ROM usage is 9kB, code is optimized enough (to my look about less than 15% wasted comparing if I was writing it in assembler)
assuming each assembly line is 2bytes of the ROM, it is 4.5k lines, and source is about 3,5k
so hate's calculation is more or less accurate
|
|
« Last Edit: April 16, 2007, 08:48:20 20:48 by Dembo »
|
Logged
|
|
|
|
micropar
Active Member
Offline
Posts: 173
Thank You
-Given: 44
-Receive: 13
|
|
« Reply #58 on: April 16, 2007, 09:10:35 21:10 » |
|
Hi all,
I agree with Bluex.
I have 20 years of experience with C/C++ using it for embedded as well as PC side programming. My most projects are very complecated with lots of features, added and derived from my earlier programming. I normally do prototype software with Turbo C, make it compile without error and then I port the same to embedded.
Hitech is the best I found among PIC series besides defacto Keil C51 for 8051. The semantic analysis of Hitech is so good that many times, bugs that are un-noticed with TurboC are noticed by Hitech and it suggest its remedial action, too, very nicely.
I too consider CCS compiler as Hobbyiest or beginners one. Till as of version 4.032, it still doesn't support pointer to function, which is must if you want to write RTOS and complex state machines. If you ever had written even small compiler, you can realise that most difficult part of it are Pointer and Reference managment, as CCSinfo people have not able to offer.
Best part of Hitech Compiler are (1) support Pointer to function, (2) Strict adherence to ANSI I/O library and (3) Very compact code when you use data structures.
Bad part of Hitech is it dosen't provide accurate delay functions inbuilt in Library. Although when you use RTOS you don't requires that much too accurate delay functions as using delay fuctions in RTOS are supposed as blocking functions and bad programing practice.
Strong part of CCSinfo is their execellant library of most commonly Embedded peripherals, which makes using Compiler in C like writing programs in Basic. I too use it many times for quick prototyping on estimation of cost on bigger projects.
There is another reason why I reccommand Hitech, if you are taking up Embedded Programming as Careers full time profession seriosly. With in next few years, 32 bit ARM architecture will predominent the current 8/16 bit microcontrollers just like microcontrollers has predominated currently that of earlier microprocessor embedded boards of 8085, Z80, 68000 etc. Now to program in 32 bit ARM, you requires good ANSI adherence, good programming habbits of using data structures etc. all that Hitech offers and caters today.
I regret for inconvenience caused or feeling hurt to anyone, as I was expressing my opinion, from my experince.
Regards, --micropar--
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #59 on: April 17, 2007, 10:15:41 10:15 » |
|
ANSI may be good for 32-bit ARM architecture but IMO it is not for an 8-bit architecture. Because ANSI standart defaults even the "short int" type to a "16-bit" value minimum! A 16-bit variable in an 8-bit system is slower than an 8-bit variable in an 8-bit system! Of course there is the "char" type but it is mainly for "characters" right? So I stay away from ANSI for low-end MCU's!
32-bit ARM architecture is something I also try to get familiar with but in my country where even PIC18 is not very common, ARM stays as a very special and expensive option. And I don't think 32-bit MCU's will dominate 8-bit or 16-bit parts, if 32-bit costs lower ok but even if they both the same price I prefer the low-end part for low-end systems.
Regards...
|
|
|
Logged
|
Regards...
|
|
|
bluex
Junior Member
Offline
Posts: 83
Thank You
-Given: 10
-Receive: 39
|
|
« Reply #60 on: April 17, 2007, 10:42:31 10:42 » |
|
32-bit ARM architecture is something I also try to get familiar with but in my country where even PIC18 is not very common, ARM stays as a very special and expensive option. And I don't think 32-bit MCU's will dominate 8-bit or 16-bit parts, if 32-bit costs lower ok but even if they both the same price I prefer the low-end part for low-end systems.
Regards...
32 bit ARM devices are becoming very close to most 16bits devices ... some Philips LPCxxxx are just about 16 euros and have by far more ROM/RAM and internal hardware. The only problem with such devices FOR HOBBIST is perhaps the fact that they do not exists in DIL packages because of their numerous IO pins. But they are the PRESENT and not the FUTURE !!!! They are the most used processors in embedded hardware actually!
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #61 on: April 17, 2007, 08:32:03 20:32 » |
|
But they are the PRESENT and not the FUTURE !!!! They are the most used processors in embedded hardware actually! Actually we live the PAST here Regards...
|
|
|
Logged
|
Regards...
|
|
|
micropar
Active Member
Offline
Posts: 173
Thank You
-Given: 44
-Receive: 13
|
|
« Reply #62 on: April 18, 2007, 08:51:21 08:51 » |
|
Hi all and Hate, And I don't think 32-bit MCU's will dominate 8-bit or 16-bit parts, if 32-bit costs lower ok but even if they both the same price I prefer the low-end part for low-end systems.
Embedded future belong to 32 bit architecture, even though we hate using it, including myself. There are several reasons for it but most important are: 1) 32 bit offer almost full range of number (int) (4GB) that the human can encounters in our everyday life. For this reason once you start programming in 32 bit, you mostly don't have to think of out of range quantity or scalling the numbers obtained from A/D or I/O. 2) Timer management in embedded RTOS becomes very easy, as you start incorporating more tasks and you never have to worry about timer interrupt missing or rollover. .......If you ever designed any uP IP using FPGA core with VHDL or Verilog, you will realise more: 3) Memory addressing (4GB) becomes simpler 4) Opcode format becomes very easy to program as you have 32 bit to play with and almost all instructions can be single cycle including Jump with pipe-lining. I hope, we should start to welcome the bright future of ours in 32 bit world, warmly, Regards, --micropar--
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #63 on: April 18, 2007, 10:00:41 10:00 » |
|
Yes you are right for all the things you say but those are mostly high-end systems requiring 4GB memory. I'm not talking about low-end MCU's for high-end systems, I'm talking about low-end MCU's for low-end systems! At least this will be my choice if the low-end MCU costs less!
Regards...
|
|
|
Logged
|
Regards...
|
|
|
Robi
Newbie
Offline
Posts: 20
Thank You
-Given: 54
-Receive: 1
|
|
« Reply #64 on: April 18, 2007, 02:29:33 14:29 » |
|
hate, you have my sympathy as I pretty agreed with all that you say but you shouldn't wasting your time with those who want not to hear or understand. It sounds to me as a few guys here prefer doing 0.1'' hole with auger instead using mini-drill or does that hide their personal frustration in using low-end products? May or maybe not. What I know is that the tool one may use make not him necessarely professional.
|
|
« Last Edit: April 18, 2007, 02:36:55 14:36 by Robi »
|
Logged
|
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #65 on: April 18, 2007, 07:06:12 19:06 » |
|
CCS C VS HT-PICC I compiled this file with CCS c and ht-Picc. The list file in here.
************************************************* void main(void) { int i; for (i =110; i<0; i++) { i++; } i = 100; }
*************************************************************************************** CCS PCM C Compiler, Version 4.032, 60629 19-四月-07 12:31
Filename: C:\Documents and Settings\user\My Documents\12.lst
ROM used: 42 words (1%) Largest free fragment is 2048 RAM used: 8 (2%) at main() level 8 (2%) worst case Stack: 0 locations
* 0000: MOVLW 00 0001: MOVWF 0A 0002: GOTO 004 0003: NOP .................... #include "C:\Documents and Settings\user\My Documents\12.h" .................... #include <16F946.h> .................... //////// Standard Header file for the PIC16F946 device //////////////// .................... #device PIC16F946 .................... #list .................... .................... #device adc=8 .................... .................... #FUSES NOWDT //No Watch Dog Timer .................... #FUSES LP //Low power osc < 200 khz .................... #FUSES NOPUT //No Power Up Timer .................... #FUSES PROTECT //Code protected from reads .................... .................... #use delay(clock=20000000) .................... .................... .................... .................... .................... void main() .................... { 0004: CLRF 04 0005: BCF 03.7 0006: MOVLW 1F 0007: ANDWF 03,F 0008: BSF 03.6 0009: CLRF 1C 000A: CLRF 1D 000B: CLRF 1E 000C: BSF 03.5 000D: CLRF 1C 000E: CLRF 1D 000F: CLRF 1E 0010: BCF 03.5 0011: BCF 03.6 0012: BCF 1F.5 0013: BCF 1F.6 0014: MOVLW 00 0015: BSF 03.5 0016: MOVWF 11 0017: CLRF 17 0018: MOVLW 07 0019: MOVWF 1C .................... .................... .................... int16 i; .................... for (i =110; i<0; i++) { 001A: BCF 03.5 001B: CLRF 22 001C: MOVLW 6E 001D: MOVWF 21 001E: GOTO 026 .................... i++; 001F: INCF 21,F 0020: BTFSC 03.2 0021: INCF 22,F .................... } 0022: INCF 21,F 0023: BTFSC 03.2 0024: INCF 22,F 0025: GOTO 01E .................... i = 100; 0026: CLRF 22 0027: MOVLW 64 0028: MOVWF 21 .................... .................... .................... // TODO: USER CODE!! .................... .................... } 0029: SLEEP
********************************************************************************
HI-TECH Software PICC Macro Assembler V9.60 Thu Apr 19 01:45:36 2007 1 processor 16F946 2 opt pw 79 3 psect text0,local,class=CODE,delta=2 4 psect text1,local,class=CODE,delta=2 5 0000 6 0000 7 0000 8 0000 9 0000 10 0000 11 0000 12 0000 13 0000 14 0000 15 16 psect text0 17 07EB _main 18 ; _i assigned to ?a_main+0 19 0000 _main$i set ?a_main 20 ;11.c: 4: void main() 21 07EB 306E movlw 110 22 07EC 1283 bcf 3,5 23 07ED 1303 bcf 3,6 ;carry unused 24 07EE 00A0 movwf ?a_main 25 07EF 01A1 clrf ?a_main+1 26 07F0 2FF9 goto l3 27 07F1 l2 28 ;11.c: 13: i++; 29 07F1 0AA0 incf ?a_main 30 07F2 1903 btfsc 3,2 31 07F3 0AA1 incf ?a_main+1 32 07F4 0AA0 incf ?a_main 33 07F5 1903 btfsc 3,2 34 07F6 0AA1 incf ?a_main+1 35 07F7 1BA1 btfsc ?a_main+1,7 36 07F8 2FF1 goto l2 37 07F9 l3 38 ;11.c: 14: } 39 07F9 3064 movlw 100 40 07FA 00A0 movwf ?a_main 41 07FB 01A1 clrf ?a_main+1 42 ;11.c: 16: } 43 07FC 0183 clrf 3 44 07FD 120A 118A 2800 ljmp start HI-TECH Software PICC Macro Assembler V9.60 Symbol Table Thu Apr 19 01:45:36 2007 ?a_main 0020 l2 07F1 l3 07F9 _main 07EB start 0000 status 0003
************************************************************************************
|
|
« Last Edit: April 19, 2007, 05:33:22 05:33 by chenyi.com »
|
Logged
|
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #66 on: April 18, 2007, 07:10:48 19:10 » |
|
|
|
|
Logged
|
|
|
|
chenyi.com
Newbie
Offline
Posts: 27
Thank You
-Given: 18
-Receive: 27
|
|
« Reply #67 on: April 18, 2007, 07:17:20 19:17 » |
|
about pointers to funtions *************************** The compiler does not permit pointers to functions so that the compiler can know at compile time the complete call tree. This is used to allocate memory for full RAM re-use. Functions that could not be in execution at the same time will use the same RAM locations. In addition since there is no data stack in the PICĀ®, function parameters are passed in a special way that requires knowledge at compile time of what function is being called. Calling a function via a pointer will prevent knowing both of these things at compile time. Users sometimes will want function pointers to create a state machine. The following is an example of how to do this without pointers:
enum tasks {taskA, taskB, taskC};
run_task(tasks task_to_run) {
switch(task_to_run) {
case taskA : taskA_main(); break;
case taskB : taskB_main(); break;
case taskC : taskC_main(); break;
}
} ********************************** Use this and pointers to funtions in Ht-picc, pls look the .lst file, Vs them!!!
|
|
|
Logged
|
|
|
|
hate
Hero Member
Warned
Offline
Posts: 555
Thank You
-Given: 156
-Receive: 355
|
|
« Reply #68 on: April 18, 2007, 09:24:18 21:24 » |
|
Thnx Robi! We all share something here, either idea, either stuff, either opinion & I was just sharing my opinion
|
|
|
Logged
|
Regards...
|
|
|
|