1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,大家好。我正在阅读PIC16F1824第20章的规范。我想确定我是否正确地解释了它。当与内部时钟源一起使用时,该模块是一个定时器,并且在每个指令周期上递增。当与外部时钟源一起使用时,该模块可作为定时器或计数器使用,并在外部源的每一个选定边缘上递增。time1具有时钟源、内部时钟源和外部时钟源两类,当选择内部时钟源时,TMR1H:TM。R1L寄存器对将由Time1预分频器决定,在FoSC的倍数上增加。当选择FoSC内部时钟源时,Time1寄存器值将在每个指令时钟周期中增加四个计数。如果系统时钟被选择(FoC),每个指令时钟定时器寄存器值将增加4个计数;如果选择了指令时钟(FoC/ 4),每个指令时钟定时器寄存器值将增加1计数。在读取Time1值时会出现分辨率。为了利用Time1的全分辨率,必须使用异步输入信号来引导Time1时钟输入。可以使用以下异步源:T1G引脚上的异步事件Time1门:C1或C2比较器输入到Time1网关,因为Time1寄存器值通过4个计数,因此最后2个LSB必须为零,或者当读取Time1值时,值将是错误的。但是,如何利用Time1的全分辨率,必须使用异步输入信号来引导Time1时钟输入。
以上来自于百度翻译 以下为原文 Hi, all. I'm reading the spec of PIC16F1824, chapter 20. I would like to make sure if I interpreted it in the right way. When used with an internal clock source, the module is a timer and increments on every instruction cycle. When used with an external clock source, the module can be used as either a timer or counter and increments on every selected edge of the external source. Timer1 has two categories of clock source, internal clock source and external clock source. When the internal clock source is selected the TMR1H:TMR1L register pair will increment on multiples of FOSC as determined by the Timer1 prescaler. The quotation goes with picture 1. The internal clock source is further divided into system clock and instruction clock. if system clock is chose(Fosc), every instruction clock timer register value will increment by 4 counts; if instruction clock is chose(Fosc/4), every instruction clock timer register value will increment by 1 count. Due to this condition, a 2 LSB error in resolution will occur when reading the Timer1 I know because timer1 register value increments by 4 counts, so the last 2 LSB must be zero or value will be wrong when reading the timer1 value. But what is "To utilize the full resolution of Timer1, an asynchronous input signal must be used to gate the Timer1 clock input."? Attached Image(s) |
|
相关推荐
13个回答
|
|
这里的关键字是“to GATE”。运行FoSC的定时器可以使用外部门信号来键入和关闭,因此在该信号停止计时器之后,您可以用完整的ToSc分辨率读取其计数值。
以上来自于百度翻译 以下为原文 The keyword here is "to gate". The timer running off the Fosc can be keyed on and off using an external gate signal so after the timer is stopped by this signal you can read its count value with full Tosc resolution. |
|
|
|
对我来说,我不明白“门”是什么意思。“Fosc的计时器”是什么意思?FoC上的计时器计数?什么是“可以开启和关闭”?打开和关闭?似乎我必须在读完定时器之前停止定时器?如果我不停止它,我可能读错的值?
以上来自于百度翻译 以下为原文 To MBedder: Yeah, I don't understand what "to gate" means. What "The timer running off the Fosc" means? The timer counts on the Fosc? What "can be keyed on and off"? Turn on and off? It seems like that I must stop the timer before I read the value? If I didn't stop it, I may read the wrong value? |
|
|
|
在20.4Time1振荡器中,注意:我在中档MCU家庭手册中搜索,它指出:所以,我一直在搜索LP振荡器的延迟,但是没有相关的信息。我可能会问,这个“合适的延迟”有多长?
以上来自于百度翻译 以下为原文 In the 20.4 Timer1 Oscillator, note: I searched in Midrange MCU family manual, it states: So, I keep searching the delay about LP oscillator, but no related info. I may ask that how long is that "suitable delay"? |
|
|
|
-是的,每个FoC周期(ToSC周期)的计时器计数。-是,计数可以由门信号启动和停止。由于您的PIC具有FoCC/4的指令时钟,软件中的启动和停止定时器只能在ToSC的4的倍数上进行(即每第四个FoC脉冲,而不是第一个)。第二或第三)。当应用时,外部门信号可以立即启动/停止定时器,因此您将获得完整的定时器分辨率(ToSC而不是ToSC X 4)。这对于精确的频率和/或时间测量是有用的。
以上来自于百度翻译 以下为原文 - Yes, the timer counts on every Fosc cycle (Tosc period). - Yes, counting can be started and stopped by the gate signal. Since your PIC has the instruction clock of Fosc/4, starting and stopping timer in software can be done only on multiples of 4 of the Tosc (i.e. every 4th Fosc pulse but not 1th, 2th or 3th). The external gate signal can start/stop the timer immediately when applied, so you will get the full timer resolution (Tosc instead of Tosc x 4). This is useful for precision frequency and/or time measurements. |
|
|
|
MBedder:让我尝试解释你的评论。因为Time1的值增加了4个计数(如果指令时钟是源代码),值的读取将总是4倍(因为每个指令周期都执行代码)。对于精确的时间测量(全定时器分辨率),应用外部门信号。
以上来自于百度翻译 以下为原文 To MBedder: Let me try to interpret your comment. Since the value of timer1 increment by 4 counts(if instruction clock is the source), the reading of value will always be the multiple of 4(Because code is executed every instruction cycle). For precision time measurements(full timer resolution), the external gate signal is applied. |
|
|
|
HI,晶体振荡器启动和稳定所需的时间,可能变化很大,可能取决于晶体、电容器和连接晶体的轨迹,并且在驱动晶体的放大器中增益(放大)。1000个振荡器周期被用作其他晶体OSCI的稳定延迟。在PIC器件中的LCD,也可以作为LP振荡器的指南。或者您可以进行测量,读取TMR1寄存器,并记录所需的时间,直到第一个定时器增量实际发生。直接测量晶体振荡器引脚,是棘手的。LP振荡器工作于小信号和小电容,所以示波器探头或其它仪器可以改变电路,使振荡器不启动,或使用不同的时间。注意,除了电源应用外,可以保持定时器1振荡器始终运行。PIC16F1824,第186页,寄存器21-1的数据表:寄存器中的所有位都有这个代码:R/W-0/U也适用于T1OSCEN位,这意味着如果您设置控制位=1,并且保持这种方式,振荡器将在程序重启时保持运行,除非有电源。失败。迈西尔
以上来自于百度翻译 以下为原文 Hi, Time needed for a crystal oscillator to start and become stable, may vary a lot and may depend on crystal used, capacitors and traces connecting the crystal, and gain (amplification) in the amplifier driving the crystal. 1000 oscillator cycles is used as stabilization delay for other crystal oscillators in PIC devices, and may be taken as a guideline for the LP oscillator also. Or you may make measurements, reading TMR1 register, and record time needed until the first timer increment actually happen. Making measurements directly on crystal oscillator pins, is tricky. LP oscillator is working with small signals and small capacitances, so oscilloscope probe or other instruments may change the circuit such that the oscillator do not start, or use different time. Note, that it is possible to keep Timer 1 oscillator running all the time, except when power is applied. Datasheet for PIC16F1824, Page 186, Register 21-1: have this code for all bits in the register: R/W-0/u also for T1OSCEN bit, meaning that if you set the control bit =1, and keep it that way, the oscillator willl keep running even during a restart of the program, except when there have been a power failure. Mysil |
|
|
|
对MysIs:对不起,在PIC16F1824的数据表中,第186页是一个空白页,寄存器21-1是TXCON寄存器,它与您所说的不匹配。“在寄存器中的所有位都有这个代码:R/W-0/U”。我对这个句子没有理解。BTW,我想问一下,据我所知,T。IME1振荡器内置在引脚T1OSI和T1OSO之间。如何改变Time1振荡器的电容器?不应该总是32.67 8kHz吗?
以上来自于百度翻译 以下为原文 To Mysil: Excuse me, In datasheet for PIC16F1824, page 186, is a blank page, and Register 21-1 is the TXCON register, it's not matching what you're saying. "have this code for all bits in the register: R/W-0/u" I have no understanding with this sentence. BTW, I may want to ask that as far as I know, Timer1 Oscillator is built in between pins T1OSI and T1OSO. How could I change the capacitor of Timer1 Oscillator? Isn't should always 32.678KHz? Attached Image(s) |
|
|
|
什么?你是说“改变晶体频率”而不是“电容器”?数据表规定“Time1振荡器额定频率为200千赫”,使用您喜欢的范围内的任何晶体(用适当的电容器)。
以上来自于百度翻译 以下为原文 What? Do you mean "change the crystal frequency" instead of "capacitor"? The datasheet states that the "Timer1 oscillator is rated up to 200 Khz" frequency, use whatever crystal in that range you like (with the appropriate capacitors). |
|
|
|
振荡器内置。你需要添加晶体和电容器。
以上来自于百度翻译 以下为原文 The oscillator is built in. You need to add the crystal and capacitors. |
|
|
|
您好,PIC16F1824的数据表是DS***中的最后一个字母F是文档修订。你在阅读一个不同的或过时的文件吗?在消息7中,我指的是:第21.11部分Time1控制寄存器21-1:T1CON:Time1控制寄存器对T1 OsCon控制位有描述。寄存器文件有自己的编号,与图号分开。对于大多数控制寄存器,有这样的表,其名称为寄存器中的位和字段。在上面的位名称中,有表示每个位或字段函数的代码。图例:解释不同的代码立即在寄存器表之下,并且在每个PIC处理器的每个数据表中重复每个控制寄存器。RCE振荡器电路的功能,应该是一个石英晶体谐振器和2个小电容器连接到引脚T1OSI和T1OSO。连接图在数据表图5-5中。振荡频率由晶体连接确定。电容器连接的电容,连同电路卡迹线的电容,IC封装引脚和键合线,应与使用时的负载电容相对应。晶体在生产过程中被修整,以实现晶体数据表中规定的频率公差。迈西尔
以上来自于百度翻译 以下为原文 Hi, Datasheet for PIC16F1824 is DS40001419F the last letter F in the number is document revision. Are you reading a different or obsolete document? In message #7 I was referring to: Section 21.11 Timer1 Control Registers Register 21-1: T1CON: TIMER1 CONTROL REGISTER have description for T1OSCEN control bit. Register documentation have their own numbering, separate from Figure numbers. For most control registers there is such a table, with names of bits and fields in the register. In the line above the bit Names, there are codes indicating how each Bit or Field function. Legend: explaining the different codes is immediately under the register table, and is repeated for every control register, in every datasheet for any PIC processor. For the Pierce oscillator circuit to function, there shall be is a quarz crystal resonator and 2 small capacitors to be connected to pins T1OSI and T1OSO. Connection diagram is in the datasheet FIGURE 5-5:. Frequency of oscillation is determined by the crystal connected. Capacitance of capacitors connected, together with capacitance of circuit card traces, IC package pins and bonding wires, should correspond with the Load Capacitance that was used when the Crystal was trimmed during production, to achieve the frequency tolerance that is specified in datasheet for the crystal. Mysil |
|
|
|
Mysil:我注意到我的号码是DS41419ATO 1and 0和杰克:请看一张图片。这是否意味着:如果我想使用这个内部电路,我必须附加晶体和电容器。在我的上帝,我虽然我可以启用Time1振荡器只启用T1 OsCon……
以上来自于百度翻译 以下为原文 To Mysil: I noticed that my number is DS41419A To 1and0 and jack: Please take a look a picture. Does it mean: if I want to use this internal circuit, I have to attach crystal and capacitors? On my god, I though I could enable timer1 oscillator by just enabling T1OSCEN.......... Attached Image(s) |
|
|
|
这是否意味着:如果我想使用这个内部电路,我必须附加晶体和电容器?是的。这是一个“振荡器电路”,需要一个外部晶体和电容器,正如Mysil刚刚发布的。是的,它“启用”它,但它不会振荡没有这些外部组件。这就是为什么电路连接到两个外部引脚。
以上来自于百度翻译 以下为原文 Does it mean: if I want to use this internal circuit, I have to attach crystal and capacitors? Yes it does. It is an "oscillator circuit" that requires an external crystal and capacitors, as Mysil just posted. Yes, that does "enable" it, but it won't oscillate without those external components. That is why the circuit is connected to two external pins. |
|
|
|
嗨,安迪,你正在阅读一个旧文档。转到PIC16F1824:HTTPS://www. MigCHIP.COM/WWWORDSTMS/En/PIC16F1824向下滚动到“& GT;文档”选项卡,点击它打开,并下载数据表的修正版本。迈西尔
以上来自于百度翻译 以下为原文 Hi Andy, You are reading a old document. Go to the product webpage for PIC16F1824: https://www.microchip.com/wwwproducts/en/PIC16F1824 scroll down to the '>Documentation' tab, click on it to open, and download the corrected version of the Datasheet. Mysil |
|
|
|
只有小组成员才能发言,加入小组>>
5238 浏览 9 评论
2028 浏览 8 评论
1950 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3204 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2253 浏览 5 评论
777浏览 1评论
666浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
595浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
676浏览 0评论
576浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 02:58 , Processed in 1.589530 second(s), Total 102, Slave 86 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号