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 / PIC 16F877A

PIC 16F877A

|

Microcontroller › PIC › PIC 16F877A

  • This topic has 1 reply, 2 voices, and was last updated 10 years, 3 months ago by Rahul Tungar.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • August 18, 2015 at 12:36 am #3829
    San4N
    Participant

    hI,

     

    I am new to this forum. i need help of someone to guid me to program the PIC16f877a.

    I am using PIC to control the relays. for Pneumatic Cylinders and DC Motor.

    For time being. if some one can help me.

    want to use push button to control two relays with timer.

    when push button is on> o/p 1 on for 3 sec then o/p 2 on for 10sec . the sequence continues.

     

     

    #include<16f877a.h>
    #use delay(clock=20000000)
    #fuses hs,noprotect,nowdt,nolvp
     
    #byte PORTD=8
    #byte PORTB=6
    void main ()
    {
    set_tris_d(0b00000000);
    set_tris_b(0b00000011);
    set_tris_e(0b00000000);
    portd=0b0000000;
    do
    {
       if(input(PIN_B0)==0)
    {OUTPUT_HIGH(PIN_D0)&&Output_LOW(PIN_D1);}
    delay_ms(300);
      //if(input(pin_B0==0)
               {output_HIGH(pin_D1)&&OUTPUT_HIGH(PIN_D0);}
    delay_ms(1000);
     
    }
     
    while (1);
     
     
    this is my code. i am using ccs compiler.
     
    thank you, , ,
    August 19, 2015 at 7:00 am #13183
    Rahul Tungar
    Participant

    i thnk if u use timer using interrupt it will be useful.

    can u plz share your circuit diagram & code on my mail id [email protected].

    & function delay_ms(300); will give you delay of 300 miliseconds not 3 seconds

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

RSS Recent Posts

  • Hitachi SuperScan Elite 802 CRT Monitor Issues (Model CM802U) December 7, 2025
  • Sanity Check – Peltier "Cooler" for Heating and Cooling December 7, 2025
  • My Advanced Realistic Humanoid Robots Project December 7, 2025
  • Funny Images Thread! December 7, 2025
  • I am ready to move from electrical and electronics field but confused where ? December 7, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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