The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.
Questions tagged [pic18]
230 questions
-1
votes
1 answer
EEPROM 24lc256 with PIC18F4550
I am working on a university project in which i need to interface pic18f4550 with i2c EEPROM.
I implemented the following circuit using proteus simulator. The following in my connections
when I implemented the interfacing on real, I faced a problem…

Developer
- 1,803
- 2
- 15
- 26
-1
votes
1 answer
Need Help Understanding Some Of The code For Receiving and Decoding an Infrared Receiver
For the most part i can follow this code but i cant seem to grasp how the final 8-bits are constructed, see my comments below:
Original code web page see for more information
while(ir == 1);
INT0IE = 0;
while(ir == 0);
TMR0=0;
…

derill03
- 1
- 2
-1
votes
3 answers
Floating-point numbers are not printed
I am trying to create a conversion table using the C programing language. I want to convert the temperature from -250 °F to 250 °C increments of 10. However, I am not getting the Celsius output:
#include
#include
#pragma…
-1
votes
1 answer
How to check While loop "condition" inside its body after each line of code?
Here is an example of my code i can place if condition to check While condition flag and put break after each line of the body but it increase overhead. WHAT SHOULD I DO??????
while(!((kvp < (Motor_pos+2)) && (kvp > (Motor_pos-2))) ){
…

Atef El Naggar
- 1
- 1
-1
votes
2 answers
create 250ms delay in MikroC
I'm looking to create 250ms delay function with MikroC. In the code below, I don't understand what 165 in the 2nd for section does.
void MSDelay(unsigned int itime); // this is the prototype
void MSDelay(unsigned int itime) {
unsigned int i;
…

Empty Name
- 1
- 2
-1
votes
1 answer
UART only receiving FF and FE
I am currently working on transmitting from a PIC18F4620, through a FT232, to CoolTerm. I am currently only receiving FF and FE from the PIC though. I was wondering why this may be the case. The Rx - TX are correctly switched, the cable connecting…

Petertk
- 1
- 1
-1
votes
1 answer
Significance of 0xff
I was wondering was 0xff, 0x00, and 0x0f represent. TRISA, TRISB, and TRISC are the ports being used on my board.
void main()
{
TRISA = 0xff;
TRISB = 0x00;
TRISC = 0x00;
ADCON1 = 0x0f;
}

Luis B
- 1
- 5
-1
votes
1 answer
MPLAB XC8 compiler error:" no identifier in declaration "
I wrote a program that is using a Timer0 Interruption.
I can't seem to compile my code, I have an error on line 14 which is no identifier in declaration.
Here is the whole code:
#include
#define _XTAL_FREQ 4000000
#define…

maximus383
- 584
- 8
- 25
-1
votes
1 answer
How to read a digital PIC port into a single variable?
I have a practice exam question that asks me to read PORTB input logic levels into a single char variable called result. (On a PIC18F252). I had some ideas for this but I haven't got answers to check so I'm not sure whats right. This is what I was…

MendelumS
- 91
- 1
- 8
-1
votes
1 answer
How to make this for loop both dim and brighten the LED?
I have a for loop made by my teacher that dims (or brightens) an LED connected to a PIC18F2455. I have to make the code do both, first brighten, then dim it, but my C skills aren't good enough for this. How can I make this happen?
int…

Underi
- 1
- 1
-1
votes
2 answers
How to configure correctly a PIC18 port D for output direction?
I'm developing a firmware to control a PIC18F45k80 pinout on a customized board.
Before loading and programming this pic with the final version I was testing my program/debug environment (MPLABX IDE + Pickit3) with the simplest user code: toggle…

Suvi_Eu
- 255
- 1
- 3
- 16
-1
votes
1 answer
Is there any pre-builded sample code libraries for PIC18F14K50 using "XC8" Compilers only
I want to create an USB interface using PIC18F14K50. I have source code using c18 compiler but I want to update my firmware using XC8 (v1.37) compiler. I am using MPLAB X 3.25. Though the C compiler is giving me good results, I want to make my…

Ravi C
- 64
- 2
- 10
-1
votes
1 answer
Reading ports from pic18f, then do something
How can I read the first 2 bits from PORTA (RA0, RA1) and then work with them ?
I have a switch connected to each one of them, and I want to output a 1 on RB1 when both RA0, RA1 are 1.
I have configured PORTA as input and PORTB as output
MOVLW 0xF…

Ruben
- 203
- 2
- 9
-1
votes
1 answer
Displaying 2 digits number on dual 7segs LED display using PIC18F452 (Assembly)
datasheet for PIC18Fxx2
datasheet related to the 7segs that I am using can be obtained right here
edit(15/4/2013): code below is the instruction word for PORTD
ldig SET b'00001000' ;for rght digit
rdig SET b'00000100' ;for left…

Arif Samin
- 257
- 1
- 9
-2
votes
1 answer
Can someone explain "RLCF INTCON,W,C" to me?
I'd like help explaining this assembly statement because I don't quite understand it yet:
RLCF INTCON,W,C

NguyenTam
- 9
- 3