Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.
Start with "teaching" your 8051 how to play notes on a selected pin, say, P1.0 ..
For example, to play DO (262Hz) you will need to output a square wave of T=3.82ms, to play Re(294Hz) the time is 3.4ms and so on .. The other notes and their frequecies can be easily found googling ..
As you can see, you will need to use one of 8051's timers: Timer0 or Timer1 ..
Using Timer Interrupt create base time of, say, 100µs .. 10µs would be probably better, but for the sake of this excercise you can stay with 100 ..
If this 100µs routine is repeated for 38 times with P1.0 "L" and then 38 times "H" and the sequence is continously repeated for, say, 5s, the output will be DO ..
So, here: you will find out how to generate time interrupts with 8051 ..
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.