完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好。我想知道,我怎么可以有一个真正的计时器2或…在PIC16F1937中没有time1。谢谢
以上来自于百度翻译 以下为原文 Hello. I want to khow that how can I have a real timer with timer 2 or ......... without Timer1 In pic 16f1937. Thanks |
|
相关推荐
16个回答
|
|
你好,当然,你可以用初级晶体振荡器编程一个实时时钟。周期定时器之一,定时器2,定时器4或定时器6,可能是最简单和最精确的:设置定时器与预分频器,周期寄存器和后分频器,适合1毫秒的周期。让定时器共同运行。定时器每毫秒转动一次,设置为中断。在中断服务例行程序中,可以计算毫秒、秒、分钟、小时、天数和年。根据太阳、其他计时器、无线电或电视定时信号、GPS时间、NTP或任何东西的观测进行校准。如果需要,可以通过每分钟或每小时减去毫秒来调整晶体的不精确性。
以上来自于百度翻译 以下为原文 Hi, Sure, you may program a Real-time clock using the Primary Crystal oscillator. One of the Period timers, Timer 2, Timer 4 or Timer 6, may be the simplest and most precise: Set the timer up with Prescaler, Period Register and Postscaler, as suitable for a period of 1 millisecond. Let the timer run continuously, and set for Interrupt when timer roll around every millisecond. In Interrupt Service Routine, you may count milliseconds, seconds, minutes, hours, days and years. Calibrate against observation of the sun, other timekeepers, radio or television timing signal, GPS time, NTP, or whatever. You may adjust for crystal inaccuracy by adding or subtracting milliseconds every minute or hour if needed. Regards, Mysil |
|
|
|
没错。我想做一个没有任何延迟的休息时间,但是只有TMR1可以连接到ScRice 32768。我认为没有TMR1我们不能有一个正确的时间??
以上来自于百度翻译 以下为原文 Exactly.i want to make a reall time without any delay, but just tmr1 can connect to crystall 32768. And I think we can't have a really time without tmr1.correct?? |
|
|
|
“没有耽搁”是什么意思?这个说法是正确的。Mysil只是用了几段文字来解释如何使用主CPU晶体来创建实时时钟。有没有你不理解的部分?
以上来自于百度翻译 以下为原文 What do you mean by "without any delay" ? This statement is correct. Mysil just spent paragraphs explaining how to create a real time clock using your main CPU crystal. Is there some part you don't understand? |
|
|
|
|
|
|
|
意味着时间少于真正的时间还是比真正的时间多?Mysil只是用了几段文字来解释如何使用主CPU晶体来创建实时时钟。有没有你不理解的部分?我用主CPU,例如晶体20Mhz,但是当使用Interrumpt tmr2时,例如时间比实际时间要短。例如在1小时内我的下降时间是5min,所以我想要真正爆发tmr2的时间。不需要TMR1,因为我使用TMR1进行另一项工作。
以上来自于百度翻译 以下为原文 Means that time lesser than really time or more than really time? Mysil just spent paragraphs explaining how to create a real time clock using your main CPU crystal. Is there some part you don't understand? I use from main cpu for example crystall 20Mhz but when Use from Interrumpt tmr2 for example Time be lesser than really time .for example in 1h my to fall time 5min So I want really time for inteerupt tmr2 or........ whithout tmr1 becasuse I use from tmr1 for another work |
|
|
|
嗨,如果你的主振荡器有20MHz的晶体,1小时内松开5分钟,那么程序就会出错。定时器设置可能出错,中断处理程序对定时器寄存器的操作,或者停止并重新启动定时器。注意:定时器2、定时器4或定时器6的周期寄存器可能需要设置为周期-1,例如,要使定时器2以250个节拍周期运行,可以尝试:PR2=249;
以上来自于百度翻译 以下为原文 Hi, If you have 20 MHz crystal for the main oscillator, and loose 5 min in 1 hour, then there are mistakes in the program. Timer setup may be wrong, interrupt handler doing something wrong with timer registers, or stopping and restarting timer. There are many possibilities. Note: that Period Register of Timer 2, Timer 4 or Timer 6, may need to be set to period -1, E.g. to get Timer 2 to run with a period of 250 ticks, you may try: PR2 = 249; Regards, Mysil |
|
|
|
所以我可以用一个真正的时间与外部振荡器?你确定吗?那么我可以用外部振荡器来制造手表吗?那内部振荡器呢??
以上来自于百度翻译 以下为原文 So I can use a really time with Externall Oscillator?? are you sure??So I can build a watch with externall Oscillator?? What about Internall Oscillator?? |
|
|
|
|
|
|
|
这取决于你在使用什么时间。内部OcCurror精确到2%左右。比主晶体差。主晶体是更好的,但不够好,一个真正的时钟。
以上来自于百度翻译 以下为原文 It depends on what you are using the time for. The internal ocscliaror is accurate to about 2%. Worse than the main crystal. The main crystal is better but not good enough for a real clock. |
|
|
|
我想要真正的时钟。我们不能有真正的时间与TMR2或3,…没有1??
以上来自于百度翻译 以下为原文 I want for really really clock. we can't have a really time with tmr2 or 3 ,......... without 1?? |
|
|
|
PIC16F1937中容差+2%的内置振荡器在中温下正常供电时,24小时内可漂移30分钟。如果极端温度,更多的错误。因此,如果晶体失效,FSCM接管,时间就会漂移。也就是说,如果启用了故障保护,并且能够以相同的频率继续运行。关于外部振荡器,重要的是要知道术语的含义。PIC16F1937具有内部HFINTOSC。这是RC振荡器,它是内部的意义,它不依赖于任何芯片外的产品。这种振荡器对于RC电路有很好的精度,但是没有适合计时的振荡器。这被微芯片文档认为是外部的,因为它依赖于芯片外部的晶体,即使驱动晶体的放大器是内部的。您提供晶体,并且负责获得合适的组件。可以使用完全在PIC外部的振荡器,具有自己的晶体和放大器电路,向微控制器传送方波输入信号。
以上来自于百度翻译 以下为原文 Internal oscillator in PIC16F1937 with a tolerance of +- 2% may drift up to 30 minutes in 24 hours, when in moderate tempratures, and normal power supply. More error if extreme tempratures. So if Crystal fail, and FSCM take over, time will drift. That is if failsafe is enabled, and is able to keep running with the same frequency. About External oscillator, it may be important to keep aware what terminology mean. The PIC16F1937 have internal HFINTOSC. This is RC oscillator that is internal in the sense that it do not depend upon anything outside the Microchip product. This oscillator have good precision for a RC circuit, but nothing suitable for timekeeping. Then there is the main Crystal oscillator. This is regarded as external by Microchip documentation, since it depend on a crystal that is external to the chip, even if the amplifier that drive the crystal is internal. You provide the crystal, and is responsible for obtaining a suitable component. Lastly, there is External Clock, EC modes that may use a oscillator completely outside the PIC, with its own crystal and amplifier circuits, delivering a square wave input signal to the microcontroller. Regards, Mysil Mysil |
|
|
|
一个真正的时钟需要精确到每月的秒。做数学计算来计算这一点的准确性。内部振荡器随温度变化很大(见数据表),外部比较好。你应该能够用软件纠正它。定时器1与手表晶体一起工作。它的精度很高。但是,PC板的设计会对其产生影响。
以上来自于百度翻译 以下为原文 A real clock needs to be accurate to seconds per month. Do the math to calculate the accuracy of that. The internal oscillator varies with temperature to much (see the data sheet) The external is better. You should be able to c correct it in software. Timer 1 Works with a watch crystal. It is made to the correct accuracy. But, PC board design will affect it. |
|
|
|
非常精确的马克西姆DS323,如果你想要一个外部时钟。没有晶体,只是一个电池电池CR2032。
以上来自于百度翻译 以下为原文 Extremely accurate Maxim DS3231 if you want an external clock. No crystal, just a cell battery cr2032. |
|
|
|
所以我们不能有时间与TMR2和……否则TMR1
以上来自于百度翻译 以下为原文 So We can't have a real time with tmr2 and ........... else tmr1 |
|
|
|
我能将晶体32768连接到TMR2或TMR3或…我怎样才能将晶体32768连接到TMR0或TMR2或…??
以上来自于百度翻译 以下为原文 Can i connect crystall 32768 to tmr2 or tmr3 or... How can i connect crystall 32768 to tmr0 or tmr2 or....?? |
|
|
|
啊哈,你似乎不理解别人告诉你的任何事情。这里显然存在语言问题。您可以使用任何其他定时器,只要您使用主晶体,而不是内部定时器。如果它不适合您,那么您的程序中就有一个bug,但是您没有费心向我们展示您的任何代码。不,您不能。我已经确认了你不必用32kHz的晶体来定时,这只是一个方便的频率,而且可以更容易地获得非常低的功率。重要的是晶体的精度。这通常用PPM(Parts Per Million)表示。您可以自己计算出,10PPM每个月几秒内可能意味着什么错误。
以上来自于百度翻译 以下为原文 Gahhh. You don't seem to be understanding anything people tell you. There is obviously a language problem here. You can use any of the other timers, so long as you use a primary crystal, not the internal timer. If it didn't work for you, there is a bug in your program, but you have not bothered to show us any of your code. No, you can not. I already confirmed that for you back in post #5. You do not HAVE to use a 32kHz cystal for timing, that is just a convenient frequency, and makes it easier to get very low power. It is the ACCURACY of the crystal that matter. This is normally expressed in PPM (Parts Per Million). You can work out yourself what error 10 PPM could mean in seconds per month. |
|
|
|
只有小组成员才能发言,加入小组>>
5183 浏览 9 评论
2005 浏览 8 评论
1932 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3178 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2229 浏览 5 评论
739浏览 1评论
626浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
511浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
637浏览 0评论
535浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 01:43 , Processed in 1.749287 second(s), Total 109, Slave 91 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号