Question 9.25: A switch is connected to pin P1.2. Write an 8051 C program t...
A switch is connected to pin P1.2. Write an 8051 C program to monitor SW and create the following frequencies on pin P1.7:
SW=0: 500Hz
SW=1: 750Hz, use Timer 0, mode 1 for both of them.
The blue check mark means that this solution has been answered and checked by an expert. This guarantees that the final answer is accurate.
Learn more on how we answer questions.
Learn more on how we answer questions.
#include <reg51.h> sbit mybit=P1^5; sbit SW=P1^7; void T0M1Delay(unsigned char); void main(void){ SW=1; mybit=~mybit; T0M1Delay(0); else T0M1Delay(1); } } |
. . . . . void T0M1Delay(unsigned char c){ TMOD=0x01; TL0=0x67; } TL0=0x9A; } } |
Related Answered Questions
Question: 9.21
Verified Answer:
#include <reg51.h>
void T0M1Delay(void);
sbi...
Question: 9.22
Verified Answer:
//tested for DS89C420, XTAL = 11.0592 MHz
#include...
Question: 9.23
Verified Answer:
#include <reg51.h>
void T0M2Delay(void);
sbi...
Question: 9.24
Verified Answer:
#include <reg51.h>
void T1M2Delay(void);
sbi...
Question: 9.20
Verified Answer:
#include <reg51.h>
void T0Delay(void);
void ...
Question: 9.2
Verified Answer:
\fbox{XTAL oscillator} \rightarrow \fbox{÷1...
Question: 9.1
Verified Answer:
We convert the value from hex to binary. From Figu...
Question: 9.26
Verified Answer:
#include <reg51.h>
sbit T1=P3^5;
v...
Question: 9.27
Verified Answer:
#include <reg51.h>
void main(void){
T0=1;
TM...
Question: 9.6
Verified Answer:
In the timer delay calculation of Example 9-5, we ...