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

A problem with AT89C51

Hi:
I use AT89C51,I have a problem in my software to useit and that's the time that one instruction takes to execute,I mean it's so long, I think that is because of multiply instruction(ASM:MUL AB).Please let me know if it is right or not?

if freq>60HZ >> int0&int1 don't work
my chip's frequency is 8MHz.
Thank you

  • Hi,
    nope, MUL AB takes 48 clock cycles, here it is 6,0mks only. 60Hz is about 17ms so MUL is about 0.036% of timers frequncy.
    If you use ASM-language so probably your problem is that you do not save some using registers while timers ISR --- PSW is the first candidate which has not been saved often and often by ASM programmers (=

    good days!

  • MUL AB and DIV AB are the only two instructions that take 4 machine cycles to execute. All the rest take 1 or 2 cycles. But I don't think this should make a problem.

    "if freq>60HZ >> int0&int1 don't work
    my chip's frequency is 8MHz."


    What do you exactly mean? Could you specify it? (give more details, ie. show a piece of program, etc.)