Home > other >  C51 great god give advice or comments
C51 great god give advice or comments

Time:10-11

I need to use single chip microcomputer through two different pins to output square wave, want to ask next if I use two timer control square wave, how to use the external interrupt 0 to change the two square wave frequency

CodePudding user response:

If two square wave frequency, the original poster can be in in external interrupt 0 keys, define a variable record button press the number of times, according to the number of keys two same frequency square wave output, if not the same, the original poster two variables (initial values are equal), when the button pressed, one to do addition, a do subtraction, and then according to the variable values of two different frequency square wave output,

CodePudding user response:

reference 1/f, a tree may reply:
if two square wave frequency, the original poster can be in in external interrupt 0 keys, define a variable record button press the number of times, according to the number of keys two same frequency square wave output, if not the same, the original poster two variables (initial values are equal), when the button pressed, one to do addition, a do subtraction, and then according to the variable values of two different frequency square wave output,

Can you add the QQ friends, I program written to help me a look

CodePudding user response:

Can be done using a timer, ManShui is 2, how many can, take a chestnut said such as a stopwatch, can millisecond timing, timing can also be seconds, time points, etc., can such as different time of square wave output, as long as you set different threshold can be realized.

CodePudding user response:

reference 1/f, a tree may reply:
if two square wave frequency, the original poster can be in in external interrupt 0 keys, define a variable record button press the number of times, according to the number of keys two same frequency square wave output, if not the same, the original poster two variables (initial values are equal), when the button pressed, one to do addition, a do subtraction, and then according to the variable values of two different frequency square wave output,

great god, and in it, I can do with external interrupt to control his frequency, timing counter 0 and 1 are available, and found that the square wave duty ratio has been changed, I need to make it the same
  • Related