This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

22 doubts in basics of 8051

Hi 8051 experts

please help me understanding following:-

1. which was the first microcontroller
2. what does legacy port means
3. what is pulse width modulator
4. what is phase locked loops
5. what is minimum time for level triggering in 8051
6. what are usual applications of 8051
7. what does DPTR contains
8. why bit addressable SFRs are at addresses ending with 0 or 8
9. when we use timer in mode 0 it is 5 bit prescaler. what
exactly it means
10. how PD and IDL can be tested in PCON
11. how to use "user definable" flag in PSW
12. I wrote a simple program to do serial transmission. the code is
hereunder:
#include <REG51.h>
void main()
{
TMOD=0x10;
TR1=1;
SBUF='C';
}
when I m testing this program in simulator it is again and again
jumping to main itself. means transmitting C again and again. what
could be the reason.

13. where does interrupt destination like IE0=0003 lies RAM or ROM,

14. when we make an ISR interrupt value can be from 0 - 31, why 32 values when we have got just 5+1 interrupts

15. what r different addessing modes in 8051

16. can uC access Data memory and Code memory at same time.if yes,
is it also possible for extenal RAM and ROM

17. when we use timer0 in mode 3 , it get divided into two 8bit
timers, lower timer is started by setting 1 in TR0 sfr. and upper
is started by setting 1 in TR1 sfr. but basically TR1 is used for
Timer1. so will timer 1 also run at that time.

18. when we create a new project in Keil IDE, there remains an
option as "use extended linker(LX51)instead of BL51". kindly throw
some light on this.

19. how parrallel communication happens with external devices. why
there is no need for baud rate. does bits in one wire of parallel
port go one after another like serial or there is some ACK
mechanism.

20. in case of keil 8051, what goes in Stack. where global variables
remain.

21. what are different uses of 4 banks in 8051

22. what is version of keil compiler and what is the way to check
it.

Parents Reply Children

  • To cherry-pick some of the more Keil-specific questions:

    #12: Embedded programs can't "return from main"; there's nowhere to go. They should always involve an infinite loop so that they don't terminate. In this case, main() tranmits a 'C', and then executes the normal RET instruction to return from the procedure. Since the stack is full of zeroes, the return address the RET instruction will find is 0, and the program will jump to 0 -- the same location at which it begins execution on a reset. So, this program will keep executing over and over.

    #18: The Keil toolset comes with two linkers. BL51 is the "old" linker, while LX51 has extra fancy features. You need to use LX51 to support some of the more advanced options with the Keil tools. The "Assembler/Utilies" manual can fill you in on the details of the linkers.

    #20. The 8051 has an extremely limited hardware stack. The Keil C compiler does some compile-time analysis to determine the memory usage of your C code. It uses the call tree to determine what routines execute in separate branches, and thus can reuse the same memory space. Most of the information that traditionally gets pushed onto the stack in a typical C implementation, such as parameters and local ("auto") variables, is thus assigned directly to memory with the Keil tools. Normally, the stack is used only for return addresses, with some rare usage in the generated code.

    This overlay generation is efficient, but imposes some limits on the way C routines can be called, in particular with respect to recursive routines or reentrant routines. To handle these cases, the Keil tools have an option to declare routines as "reentrant". In this case, the compiler will generate code to stuff parameters and locals onto a software-maintained stack, much like a normal implementation. The resultant code is bigger and slower, but gives you the usual C semantics back when you have to have them.

    22. Currently, 7.02b for C51. Among other possibilities, uVision's "Help/About" box shows you your version.