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.

Clock using timer1 external oscillator

Status
Not open for further replies.

PA3040

Advanced Member level 3
Advanced Member level 3
Joined
Aug 1, 2011
Messages
883
Helped
43
Reputation
88
Reaction score
43
Trophy points
1,308
Activity points
6,936
Dear All

My MCU is 16f877a
I am starting to design a clock using timer1 external oscillator ( clock crystal 32678Hz ) but it dose not work with Proteus
then I changed to internal oscillator, then it is working fine
Please help
Thanks in advance


Code:
main(){
lcd_init();
TMR1L = 0;
TMR1H = 0;
TRISB = 0;
TRISC = 0;
TRISD = 0;
TMR1IF = 0;
T1CON = 0b00001000;
TMR1ON = 1;

while(1){
while(!TMR1IF){
lcddata(Segment[j]);
j++;
}
lcdcmd(0xc0);
lcddata(Segment[j]);
j++;
}
}


timer1.jpg
 
Last edited:

Hi,

The Crystals on OSC1 and Timer1 have no effect in Isis.

For Timer1 use the Generator to inject a signal.
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    65.9 KB · Views: 94
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Hi wp100
Thanks a lot for help
I insert a clock, but it's property window does not like your picture, can you please advice more
Thanks in advance
 

Hi wp100
Thanks a lot for help
I insert a clock, but it's property window does not like your picture, can you please advice more
Thanks in advance

Hi,

Click on the Generator Mode icon on the left hand toolbar.

That opens the Generator window, select DCLOCK, point and click the object close to the RC0 Pin and then connect its Arrow to the RC0 pin as shown in my previous picuture.

Then Right click on the U1 label and Edit Properties to open the window to select the frequency you want.

Ist not shown in the 877A datasheet but if you look in the 16F88 datasheet for Timer1 it details how to use Timer1 as a RTC - its in assembler but it should give you a good idea.
 
  • Like
Reactions: PA3040

    PA3040

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top