Apr 16, 2003 #1 J jetsam Newbie level 3 Joined Apr 16, 2003 Messages 3 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 74 instruction delays does anyone have a general formula for making PIC instruction delays??
Apr 16, 2003 #2 M ME Advanced Member level 4 Joined Mar 14, 2002 Messages 1,309 Helped 55 Reputation 112 Reaction score 40 Trophy points 1,328 Activity points 14,859 In wich programming language? Basic, C or assembly language?. In assemler you can use the NOP instruction to make one clock cycle delay. Another option for generating delays is assembler is to use the online Delay Code Generator: Check this link out too: http://www.piclist.com/techref/microchip/delays.htm
In wich programming language? Basic, C or assembly language?. In assemler you can use the NOP instruction to make one clock cycle delay. Another option for generating delays is assembler is to use the online Delay Code Generator: Check this link out too: http://www.piclist.com/techref/microchip/delays.htm
Apr 16, 2003 #3 electro Junior Member level 3 Joined Apr 12, 2001 Messages 27 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Location Turkey Activity points 173 Goto MCU server: **broken link removed** And download the file "picdelay.zip" at the bottom of the page. Best regards
Goto MCU server: **broken link removed** And download the file "picdelay.zip" at the bottom of the page. Best regards
Apr 16, 2003 #4 J jetsam Newbie level 3 Joined Apr 16, 2003 Messages 3 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 74 tnx for the posts and linx guys. / Warning #1 - No thanks at elektroda. Read forum rules before you post! **broken link removed**
tnx for the posts and linx guys. / Warning #1 - No thanks at elektroda. Read forum rules before you post! **broken link removed**
Jun 12, 2003 #5 O OskarDust Newbie level 4 Joined Apr 14, 2003 Messages 7 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,281 Activity points 65 Re: PIC instruction delays Delay libraries use a big amount of ROM code. Simply use NOP and nested loops and try it with a osciloscope.
Re: PIC instruction delays Delay libraries use a big amount of ROM code. Simply use NOP and nested loops and try it with a osciloscope.
Jun 13, 2003 #6 SphinX Advanced Member level 3 Joined Jan 25, 2002 Messages 822 Helped 58 Reputation 116 Reaction score 29 Trophy points 1,308 Location EGYPT Activity points 7,045 Hi, Use this routine. ncount equ 0x0c mcount equ 0x0d ; pause movlw 0x__ ; M movwf mcount loadn movlw 0x__ ; N movwf ncount decn decfsz ncount,f goto decn decfsz mcount,f goto loadn return Total cycles = 3MN Example To generate 12 ms delay ( with 4 Mhz Xtal) M=N=Y so 3Y^2=12000 us so Y^2= 12000/3= 4000 so Y = Sqrt(40000) = 63.2 decimal = 0x3f so M=N=0x3f Bye
Hi, Use this routine. ncount equ 0x0c mcount equ 0x0d ; pause movlw 0x__ ; M movwf mcount loadn movlw 0x__ ; N movwf ncount decn decfsz ncount,f goto decn decfsz mcount,f goto loadn return Total cycles = 3MN Example To generate 12 ms delay ( with 4 Mhz Xtal) M=N=Y so 3Y^2=12000 us so Y^2= 12000/3= 4000 so Y = Sqrt(40000) = 63.2 decimal = 0x3f so M=N=0x3f Bye