完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
那么,参考手册中的信息无关紧要?读取应始终如下:
? 以下序列会导致错误的结果吗? #STM8定时器 以上来自于谷歌翻译 以下为原文 So, info in reference manual is irrelevant? The read should be always done as:
? Will the following sequences lead to incorrect results?
#stm8-timer |
|
相关推荐
3个回答
|
|
你好,
在您所指的三个代码片段中,唯一的多循环指令是您在Read seq_2中的INCW X. 因此,读取seq_1和读取seq_3是正常的,但不应使用Read seq_2进行16位TIMer访问。 这也意味着RM中的建议是正确的。 如果要检查指令是否在多个周期内执行,请参阅 http://www.st.com/content/ccc/resource/technical/document/programming_manual/43/24/13/9a/89/df/45/ed/CD00161709.pdf/files/CD00161709.pdf/jcr:内容/翻译/ en.CD00161709.pdf 表42第64至74页的表格显示了循环次数。 如果这还不清楚,请告诉我 以上来自于谷歌翻译 以下为原文 Hello, In the three code snippets you are referring too, the only multiple cycle instruction is the INCW X you have in the Read seq_2 As a consequence Read seq_1 and Read seq_3 are OK, but you should not use Read seq_2 for 16-bit TIMer access. This also means that the recommendation in the RM is correct. If you want to check if an instruction execute in multiple cycles, please refer to http://www.st.com/content/ccc/resource/technical/document/programming_manual/43/24/13/9a/89/df/45/ed/CD00161709.pdf/files/CD00161709.pdf/jcr:content/translations/en.CD00161709.pdf .The Table 42 page 64 to 74 has a column showing the number of cycles. Let me know if this is still not clear |
|
|
|
这是来自您链接的doc:
而对于Seq_3:ldw是2循环指令。它用于将TIM1-> CNTRL加载到索引寄存器。 在Seq_1我犯了错误。 LD无法从内存加载到XL。 因此,这三个读取都不会组合或返回正确的结果。 目前我正在使用''mov _store_mem,_ read_mem 它得到了这份工作吗?因为我不知道外围功能如何受到指令大小或执行时间的影响。如果在读取高位寄存器和低位寄存器之间有5-10-20个单周期指令怎么办? 以上来自于谷歌翻译 以下为原文 This is from doc linked by you: And for Seq_3: ldw is 2 cycle instruction. It's used to load TIM1->CNTRL to index register. in Seq_1 I've made mistake. LD could not load from memory to XL. So, none of this three reads will assemble or return correct result. Currently I'm using ''mov _store_mem, _read_mem
Does it get the job? Because I don't know how peripheral feature could be impacted by instruction size or exec time. And what if I have 5-10-20 single cycle instructions between reading High and Low registers? |
|
|
|
我在STM8S103F3P6 rev Y上尝试过,无论我做什么,只要在TIM1_CNTRL之前读取TIM1_CNTRH,我就无法读取定时器以返回错误的答案。我甚至尝试读取CNTRH,调用函数将该值写入UART,读取CNTRL,它仍然是正确的。
我的测试程序:停止计数器,将0xffxx写入CNTR,启动计数器,少数NOP,然后以各种方式读取CNTRH / CNTRL。重复增加起始值。在某些时候,你会看到计时器翻转。 以上来自于谷歌翻译 以下为原文 I tried it out on a STM8S103F3P6 rev Y, and no matter what I do, I cannot get the timer read to return the wrong answer, as long as I read TIM1_CNTRH before TIM1_CNTRL. I even tried reading CNTRH, calling a function to write that value to the UART, reading CNTRL, and it was still correct. My test procedure: stop counter, write 0xffxx to CNTR, start counter, handful of NOPs, and then read CNTRH/CNTRL in various ways. Repeat with incrementing start value. At some point, you'll see the timer roll over. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2642 浏览 1 评论
3208 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1783 浏览 1 评论
3611 浏览 6 评论
5989 浏览 21 评论
939浏览 4评论
1316浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
584浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1303浏览 3评论
1361浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-24 22:27 , Processed in 0.985145 second(s), Total 83, Slave 66 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号