EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / Pic16f690 interfacing wih two 7 segment using 7447 delay using timer 0

Pic16f690 interfacing wih two 7 segment using 7447 delay using timer 0

|

Microcontroller › PIC › Pic16f690 interfacing wih two 7 segment using 7447 delay using timer 0

  • This topic has 0 replies, 1 voice, and was last updated 10 years, 1 month ago by Hirenn.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • February 15, 2016 at 7:05 am #4291
    Hirenn
    Participant

    Hi Everyone

    i'm using PIC16f690 interface with two seven segment by 7447

    im making 0 to 99 counter by using timer 0 of pic controller

    i write a code but it shows only ''0'' on my both 7 segment…

    can anybody please help me to figure out the problem

    Thanks

    #include <htc.h>                          // hi tech compiler for pic16


    #define _XTAL _FREQ 4000000       // 4 Mhz freq
    int overflow = 0;                       // counter variable for 0 to 99
     
    void interrupt ISR(void)           // timer interrupt
    {
       if(T0IF)
       {
          overflow++;
          T0IF=0;
          }
       }
     
    void timer0()
    {
       PSA = 0;
       T0CS = 0;
       
       PS1 =1;                          //prescaler 1:256
       PS2 =1;
       PS0 = 1;
       T0IE = 1;
       T0IF=0;
       GIE = 1;                         // global interrupt enable
       
       }
    void main(void)
     {
        unsigned short second=0;
        unsigned short x,y=0;             // for display on segment
        TRISC = 0;
        TRISB7 = 1;
        ANSEL = 0x00;
        ANSELH = 0x00;
        TMR0 = 0;
        timer0();                       //timer0 function
       while (1)
       {
          if(overflow==15)
          {
         second++;
         overflow = 0;
          }
     
         if(second>99)
         {
            second =0;
            }
            x = second/10;
            y = second%10;
            PORTC = (y<<4)+x; // PORTC connected with 7 segment via 7447
          }
     }

  • Author
    Posts
Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • isolating S-params in of PCB board without connectors April 11, 2026
  • Assistance locating a 'trail' camera gadget, please ? April 10, 2026
  • Raise your hand if your car had one of these: April 10, 2026
  • Some opamp advice please April 10, 2026
  • Voltage comparator circuit verification April 10, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise