??? 07/27/06 19:59 Modified: 07/27/06 20:02 Read: times |
#121213 - are You sure? Responding to: ???'s previous message |
Peter Dannegger said:
I like C, because reusing code on another CPU was many times easier.
I use lot of code almost unchanged on different architectures, e.g. key debouncing, UART-buffering, software RTC+calendar, 1-wire, I2C, CAN and many others on 8051, AVR, ARM. Well, it is common mean that C is universal language; but this is a myth at least for the point mentioned by you placed over MCUs. Indeed, skeleton of algorithms and (sometimes) structuring at paper seems good -- but as long you do not come at programming routines. You may say: "what is a problem -- I just replace defines and headers and it does work on other core". Well, even 8051 cores have different ways to do the same. For example, you said "CAN". I shall not talk about that different tranceivers have own signaling/timings (this is different from chip-to-chip so they are hardware ones) but general usage is different due cores` realizations. I see no different between you need to re-write your code in C due [total nighmare] unspecified (expansion, core-dependent) libraries in C and new subroutines in ASM in terms of matter. What I wish to say: you may easy transfer a C code from x86 Intel(R) to AMD(R) but C51 to ARM takes a lot of thinking due real hardware realization. I do not talk about printf(), atof() etc. But even for "the same" cores think about, for example, how do you process BOFF mode flag due conversion from Atmel CC03 to Infineon (oh, there is no standard library/function for this in both seem same cores). Anyway you need to do some hand-work -- there are many not-ANSI waypoints. Sometimes it is better to use even read-to-use ASM routines to do the same when conversion than try to imagine what is __ARM_blablabla() means and which __C51_i_try_do_same() does seem same do. Regards, Oleg |
Topic | Author | Date |
How long we see 8051 | 01/01/70 00:00 | |
unofficial history of 8051 | 01/01/70 00:00 | |
History, or prediction? | 01/01/70 00:00 | |
It seems to gain, not lose | 01/01/70 00:00 | |
Does it matter? | 01/01/70 00:00 | |
Double negative? | 01/01/70 00:00 | |
to C or not to C | 01/01/70 00:00 | |
Defintely 'C'! | 01/01/70 00:00 | |
yeah, let's flame! | 01/01/70 00:00 | |
Defintely 'C'! | 01/01/70 00:00 | |
arguments | 01/01/70 00:00 | |
An example for 8051/AVR | 01/01/70 00:00 | |
contra-example for 8051/AVR | 01/01/70 00:00 | |
A slight mistake | 01/01/70 00:00 | |
stdint.h | 01/01/70 00:00 | |
That's your trouble, then! | 01/01/70 00:00 | |
Compiler independant | 01/01/70 00:00 | |
C is not better | 01/01/70 00:00 | |
bringing 2 togethert | 01/01/70 00:00 | |
Opening pandora's box | 01/01/70 00:00 | |
Learning C | 01/01/70 00:00 | |
for a beginner ...![]() | 01/01/70 00:00 | |
are You sure? | 01/01/70 00:00 | |
Portability and scars | 01/01/70 00:00 | |
I'm an ASM Guru but | 01/01/70 00:00 | |
why discuss the rare exception tha same apply | 01/01/70 00:00 |