如何在C中设置PIC16F877的内部时钟频率 [英] How to set internal clock frequency of PIC16F877 in C

查看:384
本文介绍了如何在C中设置PIC16F877的内部时钟频率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PIC16F877和HI-TECH C编译器,希望在代码中包含一些延迟,但是我不知道如何预分频时钟或如何设置PIC coz的固有时钟频率,我想使用内部时钟.我也不知道如何在C中声明和使用PORTS和PORTS位.我是微控制器领域的新手,请帮忙!!!!!

I am using PIC16F877 and HI-TECH C Compiler and I wish to include some delays in my code, but i do not know how to prescale the clock or how to set the iternal clock frequency of the PIC coz i wanna use the internal clock. I also dont know how to declare and use the PORTS and PORTS bits in C. I am new in the field of microcontrollers, please help!!!!!

推荐答案



您真的在错误的论坛上. Microchip(制造芯片)有自己的论坛,这实际上是非常好的.这是链接....


[ ^ ]

您将需要参考数据表以了解具体如何设置芯片的信息,而Hitech编译器帮助则提供有关如何以及如何调用relevent函数的信息. (我不使用Hitech,所以在那里我无法为您提供帮助.)

再没有了.

祝你好运,:)

FTFY!但是,仍然有一些人在踢. :laugh:[/edit]
[edit] (我也不知道你也是!!:笑:Ali) [/edit]
(是的.首先从Uni的嵌入式Z80开始,然后通过HD64180/Z180带旋钮的Z80",SGS,PIC和ARM上下,左右移动,具体取决于需求和硬件设计者.)[/编辑]
[edit ](我们6502开发人员真的很嫉妒Z80的16位寄存器!:mad:.... :-D) [/edit]
哦,是的-以及完全向量化的中断,可移动的堆栈指针,用于快速中断处理的备用寄存器集!虽然仍然只有一个64K的地址范围...:sigh:当我认为我们在32K ROM& 32K RAM有时让我感到惊奇:-D [/edit]
炫耀! ; P [/edit]
Hi,

You are really on the wrong forum here. Microchip (who manufacture the chip) have their own forum which is actually quite good. Here''s the link ....


[^]

You will need to refer to the data sheet for specific of how to setup the chip and the Hitech compiler help for information on what and how to call the relevent functions. (I don''t use Hitech so I cannot help you there).

There are not many embedded programmers here anymore.

Best of Luck, :)

[edit]FTFY! But there are still a few of us kicking about. :laugh: [/edit]
[edit](I didn''t know you were one too! :laugh: Ali)[/edit]
[edit](Yup. Started with embedded Z80 straight out of Uni, and moved up, down and sideways through HD64180/Z180 "Z80 with knobs on", SGS, PICs, and ARM, depending on need and hardware designer.)[/edit]
[edit](Us 6502 developers were really jealous of your Z80 with its 16 bit registers! :mad: .... :-D )[/edit]
[edit]Oh yes - and fully vectored interrupts, a movable stack pointer, alternate register set for fast interrupt processing! Still only a 64K address range though... :sigh: When I think what we did in 32K ROM & 32K RAM it amazes me sometimes :-D [/edit]
[edit]Show off! ;P [/edit]


为什么要使用877? PIC网站上将其列为不推荐用于新设计",这意味着如果他们还没有这样做,他们可能会在不久的将来停止生产.当然,它不再被列为生产中",而且我对基于这种成分的任何产品的使用寿命感到非常紧张. 他们建议改用887. [ ^ ]

另外,您真的需要更改时钟频率吗?代替使用内部计时器会更好吗?
Why are you using a 877? It is listed as "Not Recommended For New Design" on the PIC website, which means that they are likely to stop manufacturing it in the near future, if they haven''t already. Certainly, it is no longer listed as "in production", and I would be very nervous about the longevity of any product based on such a component. They suggest using the 887 instead.[^]

Additionally, do you really need to change the clock frequency? Wouldn''t it be better to use the internal timers instead?


这篇关于如何在C中设置PIC16F877的内部时钟频率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆