| Author |
Message |
yashrolyan
Joined: 04 Jul 2009 Posts: 5 Helped: 1
|
03 Oct 2009 9:27 Generation of 500ns pulse directly from 8051. |
|
|
|
|
I need help to generate a 500ns, 50% duty cycle squre wave directly from microcontroller 8051/8052/8055wd.
is it possible? if yes how?
Thanx in advance.
-Yash
|
|
| Back to top |
|
 |
kashif22041
Joined: 03 Oct 2009 Posts: 4 Location: Pakistan
|
03 Oct 2009 10:12 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
in 8051 if a 12MHz crystal is used on inst is 1us long
so even if ur prgrm is a single inst it will take 1us
so i think 500ns is not possible unless u use a MC with a different crystal.
Also a 11.0592MHZ will not help. 
|
|
| Back to top |
|
 |
yashrolyan
Joined: 04 Jul 2009 Posts: 5 Helped: 1
|
03 Oct 2009 10:21 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
it is right but many controller can generate time period much more then it instru time like in intel 8049 core (previous core then 8051)....
is it also possible in 8051?????
|
|
| Back to top |
|
 |
Google AdSense

|
03 Oct 2009 10:21 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
nandhu015
Joined: 11 Feb 2006 Posts: 640 Helped: 46 Location: Tamilnadu, India
|
03 Oct 2009 17:21 Generation of 500ns pulse directly from 8051. |
|
|
|
|
try micro that runs at higher speed. There are 8051 core micro's like AT89LP213 (single cycle core).
Nandhu
|
|
| Back to top |
|
 |
CMOS
Joined: 06 Jan 2004 Posts: 810 Helped: 39 Location: USA
|
03 Oct 2009 18:55 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
If you use a 24MHz crystal, instruction time is 500ns.
So may be something like this should work for single pulse
SETB P1.0
CLR P1.0
but for continuous pulses, the frequency will reduce and duty cycle will not be 50% because of SJMP instruction.
LOOP:
SETB P1.0
CLR P1.0
SJMP LOOP
As recommended by others, use a higher speed microcontroller.
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
03 Oct 2009 19:44 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
| nandhu015 wrote: |
try micro that runs at higher speed. There are 8051 core micro's like AT89LP213 (single cycle core).
Nandhu |
Nandhu:
Do you know where to purchase any AT89LP213? I can't seem to find any anywhere in the world! The only way to order them is large amounts and lead times are usually 6 - 8 weeks.
|
|
| Back to top |
|
 |
syrax
Joined: 15 Sep 2005 Posts: 176 Helped: 8
|
04 Oct 2009 11:00 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
I suggest to make it with some AVR 16 Mhz - ~16Milion instr per sec you need only 2Mhz real Freq if you choose AVR i will give you a code !
regards from Bulgaria
|
|
| Back to top |
|
 |
GetDeviceInfo
Joined: 30 Mar 2009 Posts: 103
|
04 Oct 2009 18:11 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
| Atmels 89L4502 offers PWM mode on timers, running at clock speed.
|
|
| Back to top |
|
 |
nandhu015
Joined: 11 Feb 2006 Posts: 640 Helped: 46 Location: Tamilnadu, India
|
04 Oct 2009 18:35 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
| ctownsend wrote: |
| nandhu015 wrote: |
try micro that runs at higher speed. There are 8051 core micro's like AT89LP213 (single cycle core).
Nandhu |
Nandhu:
Do you know where to purchase any AT89LP213? I can't seem to find any anywhere in the world! The only way to order them is large amounts and lead times are usually 6 - 8 weeks. |
Sorry i dont know. Most of the chips i look at the web is not available in my location. I have to import here. I thought it might be available in other places.
Have you tried ebay
Nandhu
|
|
| Back to top |
|
 |
ctownsend
Joined: 27 Nov 2004 Posts: 301 Helped: 21 Location: Canada
|
05 Oct 2009 4:42 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
| nandhu015 wrote: |
| Have you tried ebayNandhu |
yes, nothing. Can't find them anywhere. I managed to find some AT89LP216, however they are more expensive when compared to avr.
|
|
| Back to top |
|
 |
syrax
Joined: 15 Sep 2005 Posts: 176 Helped: 8
|
05 Oct 2009 8:08 Re: Generation of 500ns pulse directly from 8051. |
|
|
|
|
the AVR choise is better chip prize great oportunities. The code for pwm is simple , or if you don't needt phase correct pwm /Clear on Compare/ is other good variant
timer count from bottom to top , when counter equal to compare value the pin can togle. On top the too and update timer . This is only CTC mode of timer
|
|
| Back to top |
|
 |