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

Back to Subject List

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


 
#104213 - Re: 100kHz square wave out
Responding to: ???'s previous message
Hi Paul,

The short answer is you can, but we're approaching the limit of what a 'good ol' industry standard' 8051 can do - with or without timers!

Let's see, a 100kHz squarewave has a 10us period during which 5us-on/5us-off.

Now, using a 'standard 8051 - 12MHz' part timing, a jump instruction takes 2 usecs and an Acc increment takes 1 usec. So you may have to try something like this instead:

Start:
nop
cpl p1.5
nop
sjmp start:

Or alternatively, if you want to toggle the waveform on/off:

sqrwave:
jb waveflag,waveform_end
cpl p1.5
sjmp sqrwave

waveform_end:
ajmp main

This code would allow you to control the output waveform from an interrupt service routine.

Valentin




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