Questions tagged [pic16f877a]

8-Bit microcontroller from microchip

35 questions
6
votes
1 answer

"Not enough RAM " error in PIC16F877a

I have been trying to run the following code: void reset(); int board[8][8]; int i,switcher,j,k; void main() { TRISB = 0X00; TRISD = 0X00; TRISC = 0X00; reset(); ADCON1 = 0X06; TRISA =0X11; while(1) { for(…
ferty567
  • 73
  • 3
4
votes
2 answers

Why doesn't the switch command in this code work?

I want to create a clock using a timer (TMR2) to do the calculation and display current time. I have a problem dealing with the switch statement and couldn’t identify where the problem is. When I run the code in Proteus to test and write the…
chuackt
  • 609
  • 3
  • 9
3
votes
1 answer

Setting PORTA of a PIC16F877a as digital

I have an LCD hooked up to the A ports of a PIC16F877a (A0, A1, A2 etc). However, the display doesn't work because PORTA is configured as analog by default. In an PIC18F46K22 I'd do it using ANSELA = 0x00; but there is no such option in the…
3
votes
2 answers

PIC16F877 pin functions order in pin name

For example, one pin's name is RA2/AN2/VREF so I wondered what the order is of the functions on this pin. Are they the same or left to right or reverse? Thank you for your answer.
2
votes
2 answers

PIC16F877A External Crystal giving 60Hz

I'm new around here. Usually I read a lot of stuff and find all info I need, but this once I googled my fingers till blood, yet to no avail. Recently got my hands on PIC16F877A. It wasn't MCU of my choice, I have another PIC, which I couldn't get to…
Ilya
  • 3,478
  • 7
  • 33
2
votes
1 answer

PIC16F877A don't work properly - led blink and 7 segment display problem

I'm trying to control a 7 segment display using PIC16F877A. I'm programming my PIC with a replica PICKIT 3. I'm uploading my hex code using PICKIT 3 software and MPLABX IDE. I have no problem while I'm uploading my code, only when I set up my…
Emre Badem
  • 23
  • 3
1
vote
1 answer

PIC MCU PIC16F887 not working with external power

I am a newbie with PIC doing my first project to understand how PICs work. I have some experience with Arduino and trying to learn PIC now. I have chosen PIC16F887 (40 pin DIP package) as my first PIC chip. I am using MPLAB v5.30. I am only trying…
Anurag
  • 153
  • 1
  • 6
1
vote
3 answers

How do I perform division of two numbers in PIC16F877A in assembly language?

I'm currently using MPLABX IDE to develop for a PIC16F877A microcontroller. I want to divide two numbers and find out the quotient (let the two numbers be 10 and 4) and store in a register. I was thinking of a loop which increments the value of…
1
vote
0 answers

PIC16F877A stops working when I remove the PICkit 3

I've made codes of different sequences of lights but somehow this one does not work when I remove the PICkit 3, as long as the PICkit is on the circuit works. I am supplying my circuit with a 5V-3A power supply and I am using a PIC16F877A When I…
Victor
  • 11
  • 1
1
vote
1 answer

Programming PIC16F877a using PICKIT3

I'm trying to program a pic16f877a using PICKIT3 and MPLAB without success. I'm powering the pic with the pickit. I verified the connections almost 20 times, everythings plugged at the right place , every times when I try to burn the pic I get…
Leosa99 _
  • 11
  • 1
  • 4
1
vote
1 answer

While loop instructions in pic disassemby not clear

In an efford to save space I try to reduce the generated C code with inline asm(""); Looking at the original disassembly and good working code I do not understand line 0x17E4. void MENU_BUTTON(uchar Parm){ // This loop ends when the enter key…
Decapod
  • 3,900
  • 9
  • 23
0
votes
0 answers

Interrupt function (PIC16F MPLAB XC8)

I have two interrupt functions: one for generation of PWM signal for sinewave generation and the other is for (PWM) generating signal to battery charger. Whenever the supply is available the battery charger PWM interrupt function should work and the…
0
votes
1 answer

SPWM generation on PIC16F873A is not stable; SPWM shape changes although duty cycle is the same for all

I am using a PIC16F873A for generating an SPWM signal using CCP1 and timer 2. The SPWM is generated successfully but the signal is not stable. I have generated 50 Hz signal of SPWM frequency of 40 kHz, but after 1 or 2 SPWM cycles the pulse width…
0
votes
1 answer

Why does my ADC reading not increase when the supply voltage decreases?

I am using a 10 bit ADC and 5V supply, so resolution is \$\frac{5}{1023}\$. I decreased my voltage supply to 4V, the resolution now is \$\frac{4}{1023}\$ For both cases, I am reading a constant value of 2.5V from the potentiometer. Shouldn't my LCD…
chuackt
  • 609
  • 3
  • 9
0
votes
1 answer

Is my ACS712 sensor showing normal characteristic?

I bought a new ACS712 current sensor. VIOUT to ground is 2.560 V under no load conditions. This is very accurate as my supply is 5.12 V. I plug in an old fluorescent tube that needs a ballast and starter to check the current. The photo of…
chuackt
  • 609
  • 3
  • 9
1
2 3