Delay generation

Hello, I would like to know how can i use delays in my program as there is no inbuilt delay for 89c2051. i want to know how can i decide delay timing when I am using 12 MHZ external crystal

Parents
  • You selected the wrong process as this is a derivative of the C51 the C251 is a different processor with a different ISA (although it can be made to run C51 code).

    Timing can be implemented in many ways. It is best to know how precise your delay needs to be. You can use the timers built in for fairly precise timing delays. So you need to know your delay time and how precise it needs to be first. If you need to delay a few micro seconds.
    Use useless instructions.
    Ex

    char temp;
    
    // 2-3 instruction cycles
    temp = 0;
    // 2-3 instruction cycles
    temp = 1;
    

    Perhaps some definition of how much and how precise?

    I've known many a project fail due to BAD timing delay design.

    Stephen

Reply
  • You selected the wrong process as this is a derivative of the C51 the C251 is a different processor with a different ISA (although it can be made to run C51 code).

    Timing can be implemented in many ways. It is best to know how precise your delay needs to be. You can use the timers built in for fairly precise timing delays. So you need to know your delay time and how precise it needs to be first. If you need to delay a few micro seconds.
    Use useless instructions.
    Ex

    char temp;
    
    // 2-3 instruction cycles
    temp = 0;
    // 2-3 instruction cycles
    temp = 1;
    

    Perhaps some definition of how much and how precise?

    I've known many a project fail due to BAD timing delay design.

    Stephen

Children
More questions in this forum