英锐恩单片机论坛,Microchip单片机,模拟器件,接口电路,麦肯单片机,单片机应用交流

 找回密码
 立即注册
搜索
电子烟方案单片机单片机开发深圳单片机开发
单片机方案国产单片机8位单片机电子烟方案开发
查看: 4192|回复: 1
打印 上一主题 下一主题

PIC16F877使用TIMR1之后出现的问题

[复制链接]
跳转到指定楼层
1#
发表于 2009-4-26 00:07:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
PIC16F877使用TIMR1之后 RC0和RC1口不能输出高电平了,两个引 脚都输出一个频率为100HZ的方波
请问各位这是什么原因,是程序里有些东西没有设置对还是怎么回事?
我在开TIMR1 之前RC0和RC1口能正常输出高电平,开了它之后就出了问题,我用TIMR1做的定时。
2#
 楼主| 发表于 2009-4-26 00:07:41 | 只看该作者
TMR1配置不对
tmr1配置不对,你可能设置成使用外部振荡了,

将T1OSCEN 位置0。

REGISTER 6-1: T1CON: TIMER1 CONTROL REGISTER (ADDRESS 10h)
— — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON
bit 7 bit 0
bit 7-6 Unimplemented: Read as '0'
bit 5-4 T1CKPS1:T1CKPS0: Timer1 Input Clock Prescale Select bits
11 = 1:8 Prescale value
10 = 1:4 Prescale value
01 = 1:2 Prescale value
00 = 1:1 Prescale value
bit 3 T1OSCEN: Timer1 Oscillator Enable Control bit
1 = Oscillator is enabled
0 = Oscillator is shut-off (the oscillator inverter is turned off to eliminate power drain)
bit 2 T1SYNC: Timer1 External Clock Input Synchronization Control bit
When TMR1CS = 1:
1 = Do not synchronize external clock input
0 = Synchronize external clock input
When TMR1CS = 0:
This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0.
bit 1 TMR1CS: Timer1 Clock Source Select bit
1 = External clock from pin RC0/T1OSO/T1CKI (on the rising edge)
0 = Internal clock (FOSC/4)
bit 0 TMR1ON: Timer1 On bit
1 = Enables Timer1
0 = Stops Timer1
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

小黑屋|公司首页|Microchip单片机,模拟器件,接口电路,麦肯单片机,单片机应用交流 ( 粤ICP备09008620号 )

GMT+8, 2024-4-30 18:32 , Processed in 0.054138 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表