The forums are retiring and are now closed for new topics and comments. The existing content will remain online and accessible through 2020 to provide everyone the opportunity to save any relevant information. In the spring of 2021, these Community forums will be taken offline.

Search for pic16f877a in Topics


PIC16F877A program

Hi, i am trying to build this code for like a week but didnt had any luck in making it perfect. i'm using MPLAB software for compiling and writing the program and Proteus for hardware simulation. here is the attached picture of the question i was assigned to build. if any one could please provide me with a code i would be more then happy. thanks in advance.

Topic by pizzadox747    |  last reply


Help with programming a PIC16f877A with Pickit2

I am having a really hard time programming a PIC16f877A with a Pickit2 programmer or a homemade serial programmer. I have tried several ICSP interface circuits but neither programmer can read the microcontroller.  I have been able to program other PICs with each programmer without any problems. I am beginning to think that I just have a bad chip. Does anyone have experience using Pickit2? A step by step breakdown would be extremely helpful.  Can anyone suggest a good interface for the PIC16f877A? I have tried connecting the pins directly to the programmer. I have also tried using pullup resistors on MCLR, and used a schematic for ICSP that I found on the Microchip website.  One thing I have yet to try is powering the chip with an external power supply, Would this method work? 

Topic by carjo3000    |  last reply


PIC16F877A coding to interface with MATLAB(GUI)

Hello, i just to ask anyone who know how to interface PIC16F877A with GUI(graphical user interface) using MATLAB ? Thank you

Topic by esan  



My First Project (Electronic Questions)

Good morning everyone. I'm new but very optimistic on the creation and programming in PIC and I would love Buddy aid for my project. Project Idea: Store 60 responses at most 1 character (núemro or letter), to questions such as: 1 = 2 = 3 = 60 = .... At the end of the data / informed responses would be sent to the PC via USB cable or WIFI for later imported by the PC system. My questions prior to starting the project would be as follows: I'm thinking of using PIC16F877A microchip and NOKIA5110 screen. A) Any other microship less expensive cases do this activity? B) The screen initially want to use this model because it allows me to print graphs on startup and letters larger than 16x2 screens. The following outline of the design for greater understanding.

Topic by clicsis    |  last reply


Salvaged smd micro controlers.

Hello everyone, i just salvaged some great finds i think i have a surface mount PIC16F72-1/SO and a PIC16F877A, plus a few other componets. i am wondering what do i need to be able to program and use these PIC's i have very limited knowledge on micro controlers, i am currently learning with the Arduino UNO. and help would be appreciated. and also i have salvaged some other parts kia324f "quad amp" will this work like the more commonly used op amp's i see in other instructables, ATMEL346 not sure what i can use this for. i have more parts that i am unsure of what if anything i can use them for but i dont want to bother everyone with my list =) ill try and post them a little at a time. and agian thank you in advance for your information.

Topic by omnacron    |  last reply


how to write a program to control switch and LED

This program is based on How to Program Switch and LED Connected with PIC16F877A. http://www.kynix.com/BlogImage/9.4.7.png    The following code demonstrate, how to write a program that scan the switch status and turn on and off LED. The switch is connected at PORTE bit-0 and LED connected on PORTB bit-0. When switch is read as high state, the LED is turn-on and when switch state is low, LED is turn-off. The switch debouncing rate is 5msec. The code is written in “mikroC PRO for PIC v.5.6.1” IDE and simulation is done with Proteus 8.0 SP0.  PIC16F877A-I/L Datasheet Code in mikroC [code] // switch connected on porte #define SW_AT_PORT PORTE // debounce rate 5msec #define DBOUNCE_RATE 5 // direction signal sbit LED_dir at TRISB.B0; sbit SW_dir at TRISE.B0; // bit labels portb sbit LED at PORTB.B0; sbit SW at PORTE.B0; // old state save flag bit oldstate_one_to_zero; bit oldstate_zero_to_one; void main(void) { // set porta and porte as digital ADCON1 = 0x06; // set direction as output LED_dir = 0; // set direction as input SW_dir = 1; // init LED LED = 0; // init old state flag oldstate_one_to_zero = 0; oldstate_zero_to_one = 0; while(1) { // Detect logical one if(Button(&SW;_AT_PORT, 0, DBOUNCE_RATE, 1)) { // Update flag oldstate_one_to_zero = 1; } // Detect one-to-zero transition if (oldstate_one_to_zero && Button(&SW;_AT_PORT, 0, DBOUNCE_RATE, 0)) { // Update flag oldstate_one_to_zero = 0; // LED ON LED = SW; } // Detect logical zero if(Button(&SW;_AT_PORT, 0, DBOUNCE_RATE, 0)) { // Update flag oldstate_zero_to_one = 1; } // Detect zero-to-one transition if (oldstate_zero_to_one && Button(&SW;_AT_PORT, 0, DBOUNCE_RATE, 1)) { // Update flag oldstate_zero_to_one = 0; // LED OFF LED = SW; } }} [/code]

Topic by narne    |  last reply


Help on a phone automatic charger project

Hello everyone,Im trying to build a circuit that allows a phone to be charged by a PowerBank automatically and I obviously need your help since Im kinda new to all this.So the idea is to connect a phone to a powerbank using a relay. This relay is controlled by a PIC16F877A.The Powerbank turns on once it is connected and off when disconnected. Im planning on using an android application to turn on the flash light once the phone is on 15% so that the LDR detects it and the PIC command the relay to switch. So once the powerbank gets connected it should turn on and start charging the phone. what do you think ? can i use a MOSFET instead of a relay ?my problem is on the determination of the exact components I need so that the phone gets charged correctly.Basically, the powerbank voltage is 5V and the phone draw a current of about 1.4A.What is the best relay and transistor to use ? or should I simply use a MOSFETHere I used a 5V relay but I need to determine the coil current to determines BJT collector current --> this determines useful BJT base current --> this determines useful base resistor values.I hope you guys can help me pick the right components to use and advise me of how I can make this work perfectly.PS : the simulation is working just fine

Question by AbdChahidS    |  last reply


PIC Programmer Com Port?

Hello, yesterday, I bought a PIC16F877A Microcontroller and This programmer. I also installed PicPro USB. I am using the serial to usb cable that came with it. The programmer has a location of  Port_#0001.Hub_#0009 in device manager. Now when I open PicPro USB and set it to  port 1, It gives me an error saying: There appears to be a problem accessing the COM port. I cant seem to find whats wrong. [Edit] I think that It is connected to port 24 (hence its name: Prolific USB-to-Serial Comm Port (COM24) ) and the problem with PicPro USB is that it can only have 1 digit port numbers, how do I fix that? Thanks.

Question by Seifpic    |  last reply




Vertical carousel for miniature parking garage project

Hi guys! I was wondering if its possible to miniaturize and simplify a parking garage lift  with the use of DC motor and servo motor then the micro controller will be a PIC16F877A. Thanks!

Topic by hponesangkikiam    |  last reply


Ghosting in LED matrix 8x8 RED

Hello All I have problem that is Ghosting in LED matrix 8x8 RED, I try solve by software and change littel to best but not fully, where on lighting that ghosting is not show but in darkness room it is show perfect. I use PIC16F877A and 74HC595 for rows and CD4017 for columns. Best Regards hosam matar

Question by hosammatar    |  last reply


Stepper Motor and an L298 Module? Answered

Hello, I bought those items: L298 Module Kit, PIC16F877A + KIT, a stepper motor my friend found in an old printer (with four wires (2 coils)), and the pic programmer. I am lost trying to find out how to wire this thing. Can someone tell me how to connect the L298 Module with the Pic kit and the basics of how to program it (not code just the concept). I already connected the stepper motor to the coil pins of the module. Thanks

Question by Seifpic    |  last reply


Question

Hi everyone and respected teachers i am jimi. and i felt in great problem i'm new one who is using ccs c and i took some tutorials about basic programming for available chips are PIC16F877A and have also ATMEGA32PU. related to PIC16F877A i wrote a program in CCS C and its compiled well with no errors or warnings and got a hex file/ output file checked on proteus8 downloaded/written on PIC16Fxxx by TL866 programmer but the hardware still not being functional i'm struggling to find a solution but i'm failed. and i have written 4 programs in different examples compiled with no error but hardware is not functional can you help me to take contribute in my first step ?? one of the code is given below i shall be thankful to you#include "D:\DEVELOPE CCSC\two inputs four led\two input 4 output.h"Void Main() {Setup_adc_ports(no_analogs);Setup_adc(adc_off); Setup_psp(psp_disabled); Setup_spi(spi_ss_disabled); Setup_timer_0(rtcc_internal|rtcc_div_1); Setup_timer_1(t1_disabled) Setup_timer_2(t2_disabled , 0 , 1); Setup_comparator(nc_nc_nc_nc); Setup_vref(false); #use Delay(clock = 8000000) Output_low(pin_b0); Output_float(pin_d0); Output_low(pin_b1); Output_float(pin_d1); While(true) { If(input_state(pin_d0) == 0) { Output_high(pin_b0); Delay_ms(2000); Output_low(pin_b0); } If(input_state(pin_d1) == 0) { Output_high(pin_b1); Delay_ms(2000); Output_low(pin_b1); } If(input_state(pin_d0) &(pin_d1) == 0) { Output_bit(pin_b0 , 0 & Pin_b1 , 0); } }}

Question by JimiO3  


How to interrupt in microcontroller?

I need your help in my graduation project It is a smart home project in which i am using two PIC micro-controllers PIC16f877A for LCD & Keypad which is a way of devices control connected to the main micro PIC18f4550 i have problems in main micro code could you help me please I am trying to achieve multi way home automation with some security like fire system and recording camera . one micro for lcd and keypad connection. another to handle interrupts coming from different ways of devices control like keypad , GSM messages serially connected , C# windows application USB connected and remote. my code https://drive.google.com/open?id=0B7jw0zvYc42cdmJPbGRzOWQ0MW8&authuser;=0

Question by AhmedA52    |  last reply


why my servo works on arduino and not pic microcontroller?

Hello, Iam trying to use servo to control the turning angel of RC car , my servo is feetech fs5113m . 1st i tried arduino , using a 5 volt supply voltage "1A" for the servo , which is lower than its actual required voltage , but it was still working perfect, i used the "sweep" in arduino examples just to test it. then i used my pic16f877a to run it , and i was facing a problem where the servo keep 'buzzing' and doesn't work until i give it a push , and i was using the same power supply , then i tried both 7 and 6 volts "0.8A". and nothing but "buzzing" here's the code : void servoRotate0() //0 Degree { unsigned int i; for(i=0;i<50;i++) { PORTB.F0 = 1; Delay_us(800); PORTB.F0 = 0; Delay_us(19200); } } void servoRotate90() //90 Degree { unsigned int i; for(i=0;i<50;i++) { PORTB.F0 = 1; Delay_us(1500); PORTB.F0 = 0; Delay_us(18500); } } void servoRotate180() //180 Degree { unsigned int i; for(i=0;i<50;i++) { PORTB.F0 = 1; Delay_us(2200); PORTB.F0 = 0; Delay_us(17800); } } void main() { TRISB = 0; // PORTB as Ouput Port do { servoRotate0(); //0 Degree Delay_ms(1000); servoRotate90(); //90 Degree Delay_ms(1000); servoRotate180(); //180 Degree delay_ms(1000); }while(1); } and its running on ISIS simulation , and its a code that i actually took from someone who tried it and worked , so help me with this please.

Question by omar emad    |  last reply