Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
11/26/05 22:01
Read: times


 
Msg Score: -2
 -2 Looks like homework
#104210 - Creating a Square wave
I'be been asked to implement a square wave with a frequency of 100KHz. However, I am not allowed to use timers. I know how to implement this with timers but am unsure how to do it without.

I was thinking of using a counter to count from a certain number down to 0 and then every time this loop finishes, complement the output. Does this sound right? If so, how can I figure out the number that needs to be counted down from (x in the code below). Using the fact that the 8051 has a 12Mhz crystal I thought I can do this: (Can I?)

Start: mov A, #x
Loop: dec A
jnz loop
cpl p1.5
jmp Start

List of 6 messages in thread
TopicAuthorDate
Creating a Square wave            01/01/70 00:00      
   Re: 100kHz square wave out            01/01/70 00:00      
      no good            01/01/70 00:00      
         Thanks            01/01/70 00:00      
            Here is no place for homeworks !            01/01/70 00:00      
         Re: no good            01/01/70 00:00      

Back to Subject List