完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
你好,不知有没有人能帮我。我已经试着按照AN592的概要构造一个简单的频率计数器一段时间了,但是我不能使它正常工作。它很少在频率上,但是大多数时候它读出1到3kHz的高度。我使用PIC16F628 A与20兆赫罐头振荡器。我用另一个端口关闭ToCKi,我确信时间间隔很快。我想问题可能在于计时预分频器。我在附上相关代码的片段,希望有人能告诉我我做错了什么。但我必须问,这件事真的有效吗?它的解决能力是什么?谢谢-提前为你的帮助。乔BurCH-K3JLS
以上来自于百度翻译 以下为原文 Hello. I wonder if someone can help me. I've been trying now for some time to construct a simple frequency counter following the general outlines of AN592, but I cannot get it to work properly. Infrequently, it's pretty much on frequency, but most times it reads 1 to 3 kHz high. I'm using a PIC16F628A with a 20 MHz canned oscillator. I'm using another port to shut off TOCKI and I'm sure that the timing interval is smack on. I think that the problem might be in clocking out the prescaler. I'm attaching snippets of the relevant code with the hope that someone can tell me what I'm doing wrong. But I have to ask, does this thing really work, and what is its resolution capability?? Thanks - in advance -for your help. Joe Burch - K3JLS Attachment(s) counter.txt (4.10 KB) - downloaded 40 times |
|
相关推荐
4个回答
|
|
关于程序集代码,我将简要介绍;)对于绝对代码,使用CBLOCK/ENDC指令声明“变量”。一定要使用.INC文件中提供的SFR符号。不要硬编码寄存器地址和位名。使用寄存器名称作为BANKSEL指令的操作数。使用“w”和“f”。无论如何,我只是计时了你的门时间,而不是100毫秒——提示:BANSEL需要两个指令周期。这里还有更有效的代码来提取预分频器。你的“OV2”片段可以组合成“OV1”片段。最后,它是IMPO。你的20兆赫振荡器必须是20兆赫。
以上来自于百度翻译 以下为原文 Regarding your assembly code, I'm going to be brief ;)
Here and here are more efficient codes to extract the prescaler. Your "ov2" snippet can be combined into the "ov1" snippet. Lastly, it's important that your 20 MHz oscillator must be EXACTLY 20 MHz. |
|
|
|
你好,我会更简短。我工作了,它的工作频率是100赫兹。但是,你引用的“更有效”的代码示例不能正常工作。只修改一个指令就可以很好地修复它。-谢谢你的帮助,乔
以上来自于百度翻译 以下为原文 Hello there. And I'll be even briefer still. I got it working, and it works with 100 hz resolution. However, the 'more efficient' code examples you quoted don't work properly. Changing just one instruction in them fixed it nicely. :-) Thanks for your help, Joe |
|
|
|
100毫秒的栅极时间应该给出10赫兹的分辨率。正如我在该链接中指出的,代码片段已经过测试,并且它们能够工作——您可能必须为您的PIC设备将寄存器符号TMR0L更改为TMR0。
以上来自于百度翻译 以下为原文 A gate time of 100 ms should give a resolution of 10 Hz. Like I stated in that link, the code snippets were tested and they work -- you may have to change the register symbol TMR0L to TMR0 for your PIC device. |
|
|
|
你好,我说我得到了一个100赫兹的分辨率,我对代码进行了修改。事实上,分辨率可能是10赫兹,因为我重新编程的那些6LED(PLJ-6LED -A)频率计数器与集成PIC16F64 8和TCXO。你可以在易趣网上找到12美元,运到你家门口。诀窍是想弄清楚如何与驱动LED的TM1637芯片接口。如果我有7个发光二极管,我确信分辨率是10Hz。我将把整个程序移植到另一个驱动1x16液晶显示器的PIC上,然后我就知道了。除了一行代码之外,我不必改变TMR0L或其他任何东西,而且它的工作非常出色。谢谢你们的帮助和帮助。乔- K3JLS
以上来自于百度翻译 以下为原文 Hello there. I stated that I was getting a 100 hz resolution with my changes to the code. Actually, the resolution is probably 10 hz as I reprogrammed one of those 6LED (PLJ-6LED-A) frequency counters that come with an integrated PIC16F648 and TCXO. You can find them on eBay for $12, shipped to your door. The trick was trying to figure out how to interface with the TM-1637 chip that drives the LEDs. If I had 7 LEDs, I'm sure that the resolution would have been 10Hz. I'm going to port the whole program over to another PIC that drives a 1x16 LCD, and then I'll know for sure. I didn't have to change TMR0L or anything else except for one line of code, and it works superbly. Thanks for your help and encouragement. Joe - K3JLS |
|
|
|
只有小组成员才能发言,加入小组>>
4779 浏览 9 评论
1815 浏览 8 评论
1733 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
2941 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2043 浏览 5 评论
420浏览 1评论
1101浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
344浏览 0评论
253浏览 0评论
LAN9252使用SQI通信,进行数字复位后读BYTE_TEST异常
1751浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-3-29 07:58 , Processed in 1.047258 second(s), Total 75, Slave 60 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 深圳华秋电子有限公司
电子发烧友 (电路图) 粤公网安备 44030402000349 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号