what has C goto do with AT89C51

Status
Not open for further replies.

crazytwism

New Member
hi
iam doing a mini project on solar tracker,it uses AT89C51 now i have a program for the micro controller, the only problem is that it is in a wierd type of C(my friends told me itis embedded c) and doesnt use assembly language,(which is the only thing i kno).now how do i burn this program onto the microcontroller,pls help.
thanx in advance.
crazytwism
 

You run the C program through a C compiler, this converts it to assembler source code. You then use an assembler to convert the assembler source to the actual machine code file, usually ending in .HEX, then use a programmer to transfer the .HEX file to the processor.

Some C compilers include an assembler as well, and produce the .HEX file in a single operation.

Unless you have a C compiler (or access to one), you will have to rewrite the program in assembler.
 
from where can i get the compiler

hi
from where can i get the compiler,cud u refer me to some sites or give me some examples
thanx in advance
crazytwism
 
Re: from where can i get the compiler

crazytwism said:
hi
from where can i get the compiler,cud u refer me to some sites or give me some examples
thanx in advance
crazytwism

I've no idea, I only deal with PIC's, a simple google search should find you something, even if it's only limted demo versions of commercial programs.
 
i dont kno how 2 use compiler

hi
i got a compiler,cud u please tell me how to assemble the program using a c compiler(actually i have got a choice of compilers visual c++,borland c++ and turbo c++,i have to thank my friends for that).now i want to kno how to convert program into assembly language.pls help.
thanx in advance
crazy twism
 
Re: i dont kno how 2 use compiler


You need a compiler for the AT89C51, PC compilers can only create programs for PC's - they are of no use to you.

To be correct, it should be called a 'cross compiler', it runs on a PC (or other computer system) but produces code for a completely different processor.
 
You can search for Keil C51.This is the C developing environment for atmel microcontrollers as well as ARMs.You can buy this software.There are copied and cracked versions too,but it's definitely illegal.
 
Whoever told you it can't use assembly was wrong, i just checked out the data sheets.

It's going to be slightly different from normal x86 assembly used on PC's though.
 
He's just trying to use a C code from somewhere else rather than writing a program from scratch.Of course assembly language is available,I've been using it since the beginning of my microcontroller interest.A compiler is what he really needs.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…