The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.
Questions tagged [pic18]
230 questions
1
vote
1 answer
LED not glowing on off by push button with PIC18f2455 in Proteus
I searched around much to glow the LED on pressing PUSH Button in Proteus . But LED glows on its on and do not turn Off on pressing Push Button in Proteus. I am working on Simulation with PIC18F2455 and here is the MicroC code.
void main() {
…

Nabeel Raza
- 71
- 1
- 8
1
vote
2 answers
PIC18F4550 USB without external crystal
Is it possible to use USB on pic18f4550 without an external crystal? I'm trying to run "HID Read Write Interrupt" example (from mikroC) but I don't have an oscillator (I have tic 3.579545mf which seems to be of no help). How can I configure my…

grabantot
- 2,111
- 20
- 31
1
vote
1 answer
Sending an 8-byte array to SPI
I am trying to set my SPI communication with a PIC18F452 from Microchip in order to send an 8-byte array to the bus (= transfer of all the bytes at once). Here is an example of what my array looks like :
array 0x0080 byte[8]
array[0] 0x0080 …

Daymov
- 45
- 9
1
vote
3 answers
How are divisions handled in the PIC18 ISA
Kind of an extension of Converting to ASCII in C , I was wondering exactly how divisions are handled on a PIC18X.
If I perform a DIV operation, how many instructions does the compiler interpret that as?
How many clock cycles will it take for the…

John Moffitt
- 5,730
- 7
- 30
- 39
1
vote
0 answers
PIC18F4550 - How to run a specific function for each character of a string send through TeraTerm?
I have a function that I have to run for each character in a string that I receive through TeraTerm. But how can I iterate through every character of the string if I receive all of them together?

israelwnb
- 11
- 1
1
vote
1 answer
PIC18F2550 Assembly BRA command
Hi I have an question about the BRA command in the PIC18F2550.
The command works according to the datasheet like following:
BRA n
-1024 <= n <= 1023
PC + 2 + 2n -> PC
But what happens when the PC gets an negative value where will it point in the…

Emil Rowland
- 538
- 5
- 25
1
vote
2 answers
pic 18F46k80 EUART
i´m trying to transfer data to computer via EUSART. I have already set all the configurate bits but serial communication still not working well. I receive only wrong data in my Pc. Here is my code for setting uart (i am using mplab compiler…

Nuke
- 19
- 1
- 4
1
vote
1 answer
Instruction cycle (PIC18)
I'm trying to understand the steps that it takes to go through an instruction and their relationship with each oscillator cycle. The datasheet of the PIC18F4321 seems to divide this process into 2 basic steps: fetch and execution. But it does not…

somename
- 23
- 4
1
vote
1 answer
I2C pull-up resistor: using an external one along with the internal
I'm implementing an I2C connection between a PIC18F4550 and an external eeprom memory. I know that an internal pull up resistor won't work, and that's why I am going to use an external one. However, I am using in the same port the last 4 pins to…

Arthur Ferreira
- 15
- 2
1
vote
1 answer
Can I program microcontroller PIC 18F4550 with matlab?
I'm devellping a line follower robot with PIC 18F4550 using Pic C compiler software , but I want to get more precision by the robot while following the line...
Can I use matlab to program this microcontoller or what is the best software that gives…

wael ben hamda
- 127
- 1
- 9
1
vote
1 answer
PIC184550: Program seems to terminate at call function
I'm writing a program that will blink red, yellow, and green LEDs off and on to match the function of a traffic light. However, when I run it in the debugger and step through (I am using MPLAB X IDE), it seems to stop after calling the function…

Jason Boer
- 11
- 1
1
vote
1 answer
Differences between org and code in Pic18 Assembly
i always worked with C so these first days with assembly are quite complicated for me, sorry for my stupid question. I've started some small assembly projects with MplabX and i don't understand if there is some big differences between this code:
rst…

Davide Ferrero
- 130
- 9
1
vote
0 answers
PIC18 read from oled (for scrolling)
I am trying to scroll in line by replacing an existing line with the new one.
For this purpose i need to read data from Oled screen(from RAM). I am using MPLAB IDE, which includes this macro:
#define ReadData(readByte) TRISD = 0xFF;oledD_C =…

Max Z
- 87
- 1
- 1
- 10
1
vote
2 answers
Initializes the UART with high priority receive interrupt in PIC18LF6722
#define InitUART( BRGVal, BRGHighVal ) { \
UARTTxD = UARTTxDInit; \
DirUARTTxD = DirOutput; \
DirUARTRxD = DirInput; …

user3732308
- 11
- 2
1
vote
0 answers
USART PIC18F45K20 receive data interrupt problems
Im currently designing an ARV for my microelectronics class and need to implement a USART on the PIC18f45k20. So far i've gotten it to receive the first character into the RCREG on a high priority interrupt. However, when it exits the interrupt…

Chris
- 651
- 2
- 10
- 16