Embedded C (reg51.h) & standard C interconnection.

Status
Not open for further replies.

AMACreative

Junior Member level 1
Joined
Aug 4, 2011
Messages
17
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,434
Hi there!

I'm working on an university final project and I'm using AT89C51 (8051) Micro-controller for hardware interface.

Now because of C library limitations, I cannot apply several functions in my code (like string control by string.h, atoi char to int conversion by iostream.h & "double" data type) without using OTHER appropriate libraries.

So my questions are:

1) Now is it OK to use other libraries along with reg51.h without disturbing my embedded C coding and micro-controller functionality intact?

2)Moreover is there any other data-type to save a rational number in?

3)Is there any other better compiler for Embedded C than Keil?

Thanks a ton in advance guys!!!
 


1)h**p://www.keil.com/support/man/docs/c51/c51_library.htm]Cx51 User's Guide: Library Reference


2) h**p://www.keil.com/support/man/docs/c51/c51_le_datatypes.htm


3) Keil Is probably the Best .
There are others compilers too ...

SDCC is opensource compiler

link h**p://sdcc.sourceforge.net/
 

To add to what Blooz has already contributed:

1) Yes, you can incorporate additional C standard libraries into you code by #include the appropriate header file.
Available standard library header file for the Keil compiler are located in the "C:\Keil\C51\INC" directory.
Additional custom libraries can also be incorporated into you code if they are portable with your compiler and device.
Notice, "iostream.h" is a C++ header file for the iostream library and not portable or compatible with most embedded C compilers.

2) The accuracy of the representation of a rational number in digital systems is largely dependent on the rational number, float point system of the compiler and the devices internal architecture. Rational numbers, which by definition can be represented by a/b, may or may not experience an inaccurate representation inherent with float point's finite precision.

Floating Point Accuracy Problems

3) While there are other compatible compilers, as Blooz suggested, Keil is one of the preferred compilers for 8051. Google for other options.

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