PIC16F877使用TIMR1之后出现的问题
PIC16F877使用TIMR1之后 RC0和RC1口不能输出高电平了,两个引 脚都输出一个频率为100HZ的方波请问各位这是什么原因,是程序里有些东西没有设置对还是怎么回事?
我在开TIMR1 之前RC0和RC1口能正常输出高电平,开了它之后就出了问题,我用TIMR1做的定时。 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]