---
+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Member level 3
    Points: 1,445, Level: 8

    Join Date
    Aug 2006
    Posts
    62
    Helped
    0 / 0
    Points
    1,445
    Level
    8

    c to hex compiler

    i have wrote a code in C language for 8051 and i want to compile it and convert it to hex file
    how can i do this

    i tried keil uvision2 but i couldnt compile it

    please help

  2. #2
    Full Member level 5
    Points: 3,553, Level: 14
    lambtron's Avatar
    Join Date
    Nov 2005
    Location
    Portland, OR
    Posts
    251
    Helped
    33 / 33
    Points
    3,553
    Level
    14

    compile c to hex

    I haven't used keil, but I have run into this issue with other compilers.

    What I sometimes do is have the linker generate a binary executable, then run a conversion program (of my own design) to convert the executable to intel hex or whatever other hex format is needed.



    •   Alt7th September 2006, 17:06

      advertising

        
       

  3. #3
    Full Member level 2
    Points: 2,870, Level: 12
    sawaak's Avatar
    Join Date
    May 2003
    Posts
    144
    Helped
    7 / 7
    Points
    2,870
    Level
    12

    convert c to hex file

    Hi,
    if u cant compile it, then check your syntax, it may be a syntax error. however, u can simply right click on Target1, then choose "options for target 'target1' " , go to the output tab and check the create hex file option. it will create hex file.

    thanks
    sawaak



    •   Alt7th September 2006, 18:52

      advertising

        
       

  4. #4
    Member level 5
    Points: 1,993, Level: 10

    Join Date
    Aug 2006
    Location
    india
    Posts
    91
    Helped
    5 / 5
    Points
    1,993
    Level
    10

    c code to hex

    HI,
    Can u check the version of the compiler you are using , because a evaluation version can execute only 2K and some one will compile upto 4K. may the problem in your compiler version......



    •   Alt8th September 2006, 07:14

      advertising

        
       

  5. #5
    Full Member level 1
    Points: 2,062, Level: 10

    Join Date
    Dec 2005
    Posts
    117
    Helped
    5 / 5
    Points
    2,062
    Level
    10

    convert c to hex

    to convert the c code to hes file u need to complie the code.as u say u compile the code using keil but not worthy u must check the following things

    1 Keil is a IDE not compliler
    2 u need keil ide for 8051 compilers www.keil.com use tool do c51
    3 RIDE51 can also be used
    4 if u do not follow the project flow in keil the hex file will not be created.



  6. #6
    Junior Member level 1
    Points: 1,391, Level: 8

    Join Date
    Aug 2006
    Posts
    19
    Helped
    0 / 0
    Points
    1,391
    Level
    8

    convert c to 8051

    this is possible with the help of keil . its a very good software in which there is facility to write a program also in c . for that firstly u have to install a keil software and after that installation complete u have to open new project in which by some instructions means which are necessary i.e there is one option which type of mc u used if u used atmel click on that then atmel ic type i.e at89c51 .
    after that write program in c and select here u want to compile in c.



  7. #7
    Full Member level 1
    Points: 362, Level: 4

    Join Date
    Sep 2005
    Posts
    118
    Helped
    10 / 10
    Points
    362
    Level
    4

    c++to hex converter

    hai
    use any compiler which supports 8051
    like c-51
    in keil when you make the project
    go to the project window
    right click on project
    select the output format
    select for hex file
    add your code in source group
    build the target
    the hex file will be created in the name of your project name
    remember,the name of the hex file will not be with the name
    of your c code name,it will be with your poject name
    this is because you can add more than one file to your project


    regards

    sun



  8. #8
    Newbie level 1
    Points: 1,384, Level: 8

    Join Date
    Apr 2005
    Posts
    1
    Helped
    0 / 0
    Points
    1,384
    Level
    8

    convert .c to .hex

    Check the project options. In "output" tab there is an option "Create Hex File"



  9. #9
    Full Member level 2
    Points: 1,843, Level: 9
    Achievements:
    7 years registered
    sci-3d's Avatar
    Join Date
    Aug 2006
    Location
    USA
    Posts
    125
    Helped
    8 / 8
    Points
    1,843
    Level
    9

    how to convert keil c file into .hex file

    The Compiler would translate C to ASM, then the Linker would create the HEX file.
    Here is a references

    http://mcu-programming.blogspot.com/...c-and-for.html



  10. #10
    Full Member level 2
    Points: 2,774, Level: 12
    sivasujith's Avatar
    Join Date
    Aug 2006
    Location
    Chennai
    Posts
    122
    Helped
    11 / 11
    Points
    2,774
    Level
    12

    convert .c file to .hex file

    hi...

    In the "options for target" donot forget to enter the crystal frequency if u are really going to dump the code into the controller.
    Check for Syntax. If u get any error number just search for the error in Keil.com
    U myt b using the Evaluation version, then the code size is restricted to b within 2K. So filter all the criterias out, u ll get thru..

    regards... pm me if u hav any pbm...

    sujith
    And also on the check box named "Create hex file".



+ Post New Thread
Please login