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.

PIC18F Timer as Ccounter Question

Status
Not open for further replies.

eepty

Full Member level 2
Joined
Oct 21, 2005
Messages
143
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,611
I am using the Microchip PIC18F45K22. I want to config the timer1 as a counter to verify an external clock 32.768kHz. However, I do not know whether I should connect the clock source to pin T1G or T1CLK. Anyone can help? Thanks!:p
 

When enabled to count, Timer1 is incremented on the rising edge of the external clock input of the TxCKI pin. This external clock source can be synchronized to the microcontroller system clock or it can run asynchronously.
Hope this helped:idea:
 

So what the the function of T1G?
 

here is a good answer: **broken link removed**
Don' forget Helped me!
 

here is a good answer: **broken link removed**
Don' forget Helped me!

I have read the datasheet but I do not understand, so I ask here.

I want to verify if an external clock is accurate. So I want to count the number of rising in a period of time, say 1 second. Is that I connect the clock source to T1clk, set T1Gpol bit to high, and use a pull up resistor to connect the T1G pin to high level?

Thank you so much
 

I'm in a similar situation. I would like to configure TIMER1 as a 16-bit asynchronous counter. According to the datasheet the configuration should be:

T1CON => RD16=1; T1RUN=0; T1CKPS1:0=00; T1OSCEN=0; /T1SYNC=1; TMR1CS=1; TMR1ON=1;

However, TMR1L and TMR1H do not increase with rising edges in T13CKI.

Any suggestion?

Thanks in advance.
 

Hi,

Well its the usual thing with the Microchips datasheets, the information is all there, so they say.

However its presentation does not lend itself to easy interpretation, particularly when 'new' functions like the TxGate are involved.

I'm just upgrading from the 4520 to the 45k22 and was also looking at Timer1 but for the rtc function using a 32k crystal, quiet a bit of difference to get it going.

I say the 'new' functions but many of them are use on the latest 16F chips, have found this tutorial which seems to explain the Timer1 functions better.
https://www.mikroe.com/eng/chapters/view/5/chapter-4-timers/

If you do find your answer there, please post your working code examples so others, me included, can benefit from your experience.
 
I have read that tutorial and it seems that my configuration it's ok...I can't see where the problem is...:(

Thank you very much anyway. If I get that it works I'll let you know.

- - - Updated - - -

Well. The configuration was right. The problem was in my test equipment. If anyone need to use the Timer1 the same way I do just have to copy the configuration I posted before.

Thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top