Re: 問各Delay的問題
|
||||
---|---|---|---|---|
中級會員
|
不好意思, 借開板大大的主題問一下, Delay1KTCYx()的時間延遲公式是如何?
如果有疑義, 小弟另行開板詢問, 謝謝.
發表於: 2008/2/26 16:59
|
|||
|
Re: 問各Delay的問題
|
||||
---|---|---|---|---|
資深會員
|
1 ms * 31.25K /4 = 7.8125
Delay1TCY(8); // Delay of 1ms
發表於: 2008/2/26 12:21
|
|||
不要問我哪裡來,我只是個流浪天涯的工程師
|
||||
|
問各Delay的問題
|
||||
---|---|---|---|---|
中級會員
|
void Delay_1ms(byte delaytime)
{ int i; for(i = 0; i < delaytime; i++) { Delay1KTCYx(6); // Delay of 1ms // Cycles = (TimeDelay * Fosc) / 4 // Cycles = (1ms * 24MHz) / 4 // Cycles = 6000 } } 上面是一段Delay的code.... 從書上抄來的..這是用實驗版所使用的code.. 用的是外部震盪器24MHz的 想請問一下我現在另外使用了一個PIC 如果使用內部震盪器...31.25k 這段code我要如何設? 因為直接使用這段code也是可以跑.... 不過會變很慢....~_~
發表於: 2008/2/26 12:03
|
|||
|