完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,我知道每一个PIC,或者不是每一个PIC,都有很多time0,Time1和Time2/4/6,每个定时器都在特殊的应用程序中使用。我需要在24MHz时钟上做出精确的时间延迟(100US),如何在所有这些计时器之间进行选择?标准是什么?谢谢,罗兰多
以上来自于百度翻译 以下为原文 Hello, I know mostly every PIC or if not every PIC, has many timer0, timer1 and timer2/4/6 and each timer is used on special applications. I need to make a precise time delay (100us) on a 24Mhz clock, how to choose between all these timer? What's the criteria? Thanks, Rolando |
|
相关推荐
5个回答
|
|
哪一张照片?他们不都是一样的,特别是在不同的家庭之间。你想要一次延误,还是每一百年发生什么事?
以上来自于百度翻译 以下为原文 Which PIC? They are not all the same, particularly between different families. Do you want a single delay, or something to happen every 100us? |
|
|
|
PIC16F1938。我希望这些100U只发生在由另一个中断触发的特殊情况下。例如,IM使用比较器模块进行中断。如果有一个比较器中断,我希望PIC计数100US,并作出一个定时器中断。大概我想做的是嵌套中断(我想是这样)。
以上来自于百度翻译 以下为原文 PIC16F1938. I want these 100us to happen ONLY on a special case triggered by another interrupt. For example, Im using the comparator module to make an interrupt. If there is a comparator interrupt, I want the PIC to count 100us and make a timer interrupt. Probably what I'm trying to do is a nested interrupt ( I think so) |
|
|
|
最大的区别是你有一个16位定时器(定时器1)和四个8位定时器(0, 2, 4,6)2, 4和6彼此非常相同。定时器1也是唯一的,因为它可以由Fosc或FoC/4来计时。其他的只能在FoC/4或更慢的时钟。如果你的时钟是24MHz,那么100US是2400个FoSC计数,或者600个FoC/4计数。一个8位定时器可以做一个4:1的预分频器和一个150的计数。我只使用一个TMR 2, 4或6,并将PR2寄存器设置为150—1= 149。一个中断触发,而另一个中断仍在运行。在几乎所有的情况下,您不希望停留在第一个中断服务中等待100U到期。中断服务的黄金法则是:“尽可能少地清除中断,然后返回。”“尽快”。
以上来自于百度翻译 以下为原文 The big difference is you have one 16 bit timer (Timer 1) and four 8 bit timers (0, 2, 4, 6) 2, 4 and 6 are prety much identical to each other. Timer 1 is also unique in that it can be clocked by Fosc or Fosc/4. The others can only be clocked at Fosc/4 or slower. If your clock is 24MHz, then 100us is 2400 Fosc counts, or 600 Fosc/4 counts. An 8 bit timer can do that a 4:1 prescaler and a count of 150. I'd simply use one of TMR 2, 4, or 6, and set the PR2 register to 150-1 = 149. No. A "nested" interrupt is when one interrupt triggers while another interrupt is still running. In almost every situation, you would NOT want to stay inside your first interrupt service waiting for the 100us to expire. The Golden rule for interrupt services is "do the minimum required to clear the interrupt, and get back out as soon as possible". |
|
|
|
|
|
|
|
你也可以使用带有4:1预分频器的定时器0,并预装106,即256—150.0。你选择使用哪一个定时器高度依赖于什么可用,这取决于你选择PIC+你的应用程序使用(E)CCP和/或PWM修改。
以上来自于百度翻译 以下为原文 You could also use Timer 0 with a 4:1 prescaler, and preload it with 106, which is 256-150. Which timer you choose to use is highly dependent on what's available, which is determined by your choice of PIC + your application's use of (E)CCP and/or PWM modiules. |
|
|
|
只有小组成员才能发言,加入小组>>
5248 浏览 9 评论
2037 浏览 8 评论
1957 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3218 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2265 浏览 5 评论
788浏览 1评论
680浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
608浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
685浏览 0评论
582浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-28 09:27 , Processed in 1.382444 second(s), Total 84, Slave 68 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号