Micro c to ccs c code conversion

Status
Not open for further replies.

Agreed with you.

I've done quite an amount of porting from different compilers and it requires me to read the compiler manual - a lot of it.

And what's with the code which deals with floating point, especially in a PIC16F series? It's going to chew up a lot of memory and slow things down, regardless of compilers.
 
Agreed with you.

I've done quite an amount of porting from different compilers and it requires me to read the compiler manual - a lot of it.

And with small programs like that it is better to write the program from scratch. Just learn how the original code works and implement and test it step-by-step.
 
And with small programs like that it is better to write the program from scratch. Just learn how the original code works.

Yeah. The major part of microcontroller programming is to understand the registers in the peripherals too, and to understand its limitations.
 
Why would anyone want to learn C?? thats a ridiculous notion, there are more than enough people online that can program C in any compiler!! all you have to do is ask them! Ok sometimes you have to ask the NICELY, but on the whole you just got to ask. None of this learning stuff you talk about, actually the bit I dont understand was he had it working on two compilers! So he isnt learning he is switching compilers until he finds the magic one that codes for you (dont tell him which one it is )
 
He obviously doesn't want to learn C.... The changing of code from compiler to compiler is relatively simple... So it only took a minute..
 

He works on two compilers so that he can get away with the "lowest amount of space" possible in the produced *.hex file.

To be honest on any 8-bit microcontroller compilers, compiling floating point code results in a much huge output later. The coding part is more important than bothering about which compiler to use.

Plus, did he buy all of these? CCS compiler and MikroE provides very good trial versions. And that's a small piece of code he's writing anyway, so it will compile at all the trial editions. As far as I know, I have used a trial version of CCS and a licensed version of MikroC (PIC and dsPIC) and they worked pretty well.
 
If he is that concerned on space etc then why not ASM? Lets be straight here he didnt write a single line. But of course you could be right, At 13 1/2 I might just be developing cynicism! Its funny how nearly 3 years online does that to you lol
 
Lets not mock!!! If he truly understands C there won't be a problem.. However if he doesn't ( as I suspect ) the code I have modified for him will serve no purpose... If it doesn't work as expected, he won't be able to fix it... As it stands I don't know how the code will behave... I can't test it... I already think that the union I created hasn't got bit access.. This may need to be in a different part of the memory!!
 

I like to help when I think the problem is a challenge. I learn from those kinds of problems. I see that mentality here in ETO all the time and it is great.. sometimes (many times) the members here are more interested about the problem than the original poster..
 
Hello

My first post here. I need help NOW. I have exam tomorrow. What is this C everyone is talking about? Maybe C this or C that?
I C everything.

My kwestion is what is Compiler??? My Professor must have answer from me next day to start examining me.

Please hurry and give me answer now.
Dont waste time.
 
Last edited:
Enough!!! This is the reason people don't come here anymore... If you can't be constructive do not post!!
 
People will be back, post's have started to change that's a good sign. People are turning up with mad projects and asking question's because they have never seen a soldering iron before, thats how I started here. So I think we are seeing the new seeds being sown, it will take some time but I think things will grow back strong. 2 months ago I was sure this place was finished, we have been lucky it looks like it is going to regrow again!
Sometimes members having a pop at lazy people is a good thing, it makes others know it isnt a do your work for you site, its a we will do everything to HELP you site. Thats the one thing I like most about AAC, the members themselves take no nonsense, turn up with a do this for me or do that for me, and they get a shredding. Its all very polite but works, take a certain salad dressing that was banned here, he isnt doing so well over there. Mainly because the members are saying it as it is to him. The hard bit is knowing when people are going too far.
The most damaging thing I have seen here is also some of the things I like most, for example: A beginner comes along and just wants a simple answer to his problem, he has maybe built say a thermostat with a comparator as it's base. It dosnt work right, he asks a question. The choice is then sometimes to just give enough information to get it working or to go in depth about the problem. Before you know it, the experts are arguing and discussing really minute points, even the favorite conventional or electron flow, a beginner couldnt care less what way it flows what he wants to know is why it ISNT flowing.
I love those threads they get really deep into it, but they should be taken away from the original post. That way the beginner gets the simple answer he needed and is inclined to return, plus the interesting discussion still takes place so those of us that enjoy it can also join in.
Anyway I am typesetting and not experimenting!!
 
Hi Ian

Sorry for trying to put a bit of humour into things like ETO was. A fun place of learning.
And I now know that ETO does not need people like me anymore.

See you.
 
Last edited:
tvtech... The site does need people like you... but there is a subtle difference between humour and ignorance..

Some members do not see humour the same way you or I do.. Sometimes it comes across as being laughed at!! this discourages people from posting.... Just encourage posters and if they are past your help.. Just sit and watch...
 
Hi Ian

I have an active little mind. I have the unique ability to laugh at myself and all my shortcomings when I question others out there....

If I do or say something stupid I am the first to admit it. As much as a PRO as I consider myself, I like to play too. A little bit of a joke here or there always goes down well.

Nobody knows what goes on in my head (the Brain part) except me.

Oh Oh...Ratch is summoning me. There is something he want's to debate.

See you later.

Regards,
tvtech
 
thank u sir , its work on Real Pic Simulator The display and led's fine..
but when mcu enter on delay mode adc sensing function not work .
PHP:
void Delay(void){
/*   If Delay Switch is pressed (Delay_SWITCH == 0), long Delay
*   Otherwise, short Delay
*/
unsigned char timeKeeper;
LED_DELAY = 1;
if (Delay_SWITCH == UNPRESSED){
    for (timeKeeper = 0; timeKeeper < 10; timeKeeper ++){
        __delay_ms(720);          // 3 minutes Delay
    }
}
else{
      __delay_ms(2000);         // 2 seconds delay
}
LED_DELAY = 0;
}
this Delay mode we can use TMR1. like this , those in ccs c
Code:
/*****************************************************************************
Delay Defines
****************************************************************************/

#define STARTUP_SEC 15      // Change to 180 for read card
#define STARTUP_SECs 15

#define TIMER1_FREQUENCY (4000000 / 4)      // 1 clock tick = 1 instr. cycle = crystal frequency / 4


/*****************************************************************************
  Timer1 Interrupt, executed every 10 ms
****************************************************************************/
#INT_TIMER1
void TIMER1_isr(void)
{
   // Increment time_elasped to keep track of ms
   time_elasped++;
   // Increment seconds variable if 1000 ms have passed
 
   if (time_elasped == 100)  //high voltage cut led blink freqency @ 1000 ms
   {
        seconds++;
        BlinkLED1_flag=~BlinkLED1_flag;
        time_elasped = 0;
   }


   // If Quick Start switch is set between start up time, set QuickStart_flag
 
   if ((input(Delay_SWITCH)==0) && (seconds<STARTUP_SEC) )
      {
          QuickStart_flag = 1;
      }
    
   // On start up, blink LED1 for 3 mins
   //led1 blink mains normal ,led1 blink & Reads ADC
    // both are work in same time. not one by one.
    //if led1 blink duration complet then it no blink agen.
   //Has three mins passed?
 
    if (seconds > STARTUP_SEC)
    {
       BlinkMains_flag=1;
       //output_high(RL4);
    }

   //if(seconds=!TEMP_seconds)
   if(ErrorConditionExists_flag == 1)
   {
    if (TEMP_seconds > STARTUP_SECs)
    {
       BlinkMains_flag=1;
    }}
   //Reset Timer 1
   set_timer1(60545);
   clear_interrupt(INT_TIMER1); 
} 


/*****************************************************************************
  Function BlinkLED1
  Blink Low LED
****************************************************************************/
void BlinkLED1(void)
{
   if (BlinkLED1_flag==0)
   {
      output_high( LED_DELAY);
   }
   else
   {
   output_low( LED_DELAY);

   }
}
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…