Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F886 Timer 1 as counter Not counting pulses

Status
Not open for further replies.

vijaya_narayana

Full Member level 3
Joined
Jun 12, 2007
Messages
178
Helped
11
Reputation
22
Reaction score
1
Trophy points
1,298
Location
India
Activity points
2,182
Dear All

I am trying to count pulses from an external source for which i am using the Timer1 Module and timer 0 for generating the time dealy of 0.02 seconds here is the code for the same

PEIE = 1;
GIE = 1;
T0IE = 1;
T0IF = 0;
T0CS = 0;
T0SE = 0;
PSA = 0;
PS0 = 1;
PS1 = 1;
PS2 = 1;

T1CON = 0X07;
TMR1H = 0x00;
TMR1L = 0x00;
TMR0 = 0x63;
OSCCON = 0x75;

but while looking into SFR with a 10 Khz input signal i am reading only 00 on both the high and low registers pls let me know what is that i have missed
here is the code io port settings

TRISC= 0xff;
PORTC=0x00;

any help will be appreciated
 

Hi,

show your schematic.
What supply voltage do you use?

Is it real circuit or simulation?

What package do you use and at which pin number did you connect the T1 input clock?
What voltage levels (High and Low) is your T1 clock input signal?

Klaus
 

hi
i use 5V power supply and i am testing it in the real hardware

in simulation it works properly

i am connecting it to PIN No 12 , RC1

It is a proper squre pulse driven from CD40106
 

Hi,

i am connecting it to PIN No 12 , RC1
I´m not familiar with PIC, but isnt Pin11 RC0/T1CKl?

Klaus
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top