I have a few questions here:
1. Is every instruction cycle= crystal freq/4?
2. If crystal = 20Mhz, a single instruction cycle = 5Mhz or 0.2us right?
3. I wan to generate a 2MHz pulse wave with 30% duty cycle.. Can i just send HIGH to a port and then LOW it?
just like this,
_______ _______
| 30% |______70%_______| |_____________
|-150ns-| ------350ns------ |
begin:
high 0 'send HIGH to portB.0
pause 150 'delay for 150ms (writing like this,the delay is in ms,but I want it in ns)
low 0 'send LOW to portB.0
pause 350 'delay for 350ms
goto begin 'repeat
end
pause, for delay of milisecond
pauseus, for delay of microsecone
My problem is, how to make it delay in ns instead of ms and us? Is there any alternative to make a delay in ns?