how to divide oscillator frequency?

hi,

i am using pic 18f46j11 microcontroller. my controller gives 5 times delay. i used 20mhz crystal. now if i delay particular port to 1 instruction than it gives 1us instead of 200ns. (20mhz/4=5 mhz=200ns).

i want to give delay of 200ns. how can i do that?
 
If you're only getting 1uS delay for a nop instruction, it sounds like your PIC doesn't know that it has a crystal on its pins. How did you set up your configuration words?
 
hi..

i am using assembl language.

i want to on LED on portd for 200ns.

if i write instruction

SETF PORTD
CLRF PORTD

than, between these instruction port must be on for 200ns (20 mhz crystal) but it takes 1 us for remaing on.

simply,

i want to on portd for just 200ns and 2 second off.

how should i do that??
 

How are you setting your configuration word???
 
How are you measuring the output pulse width? You should also try to measure the actual instruction clock frequency by setting up your OSC to output the instruction clock (fosc/4) on one of the PIC pins.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…