The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.
Questions tagged [pic18]
230 questions
0
votes
1 answer
Latch register not showing the same value as the port register
I'm writing a program on PIC18F4550 where I have data defined in my memory and want to send it to PORTA character by character. I have done so but the values showing on LATA are not the ones shown in the PORTA register. I've searched the data sheet,…

April Crude
- 117
- 7
0
votes
0 answers
PIC USART second char always read 2 higher
I am using MPLAB XC8 and I try to use the USART module. But I have abnormal problem. Here is my code, I explain after this.
#include
#include "conbits.h"
#include
#include
#include
#include…

batgre
- 1
0
votes
1 answer
Program PIC 18LF46K42 Microcontroller
I am using MPLABX to write a simple program for PIC 18LF46K42 Microcontroller that would turn LEDs on and off after a certain delay. The compiler does not recognize "TRISB" and "LATB" registers. It looks like that I am missing some header files. I…

user3723326
- 115
- 2
- 7
0
votes
1 answer
how to combine ADRESH and ADRESL on 12 bit ADC
MICRO: PIC18LF47K42
compiler: XC8
application: MPLABX
I am trying to combine the values in of 12 bit ADC. They go into ADRESH and ADRESL. My ADC is set up for right-justify which does formating as so:
ADRESH:(----MSB,x,x,x) ADRESL:…

TJL6012
- 23
- 3
0
votes
1 answer
Pic18F67K22 will not read program memory above 0x10000
I am writing a boot loader for Pic18F67K22 device. Program data 0x200- 0x1FFFF. Boot code resides in memory location <0x200 and is unaffected by boot load program update. The program 0x200-0x1FFFF is getting proper values during programming and…

Bobby
- 659
- 2
- 13
- 26
0
votes
1 answer
Nested loop - Can someone explain this loop?
Can someone explain how this type of loop works, I took it from a code that has a total delay of 1 second, I didn't understand the LOOP 2 and 3 function.
DELAY:
MOVLW 0X44
MOVWF C1
LOOP3:
MOVLW 0X33
MOVWF C2
LOOP2:
…

Dragnovith
- 3
- 2
0
votes
0 answers
Problem with second digit value on Seven Segment Display for MCU voltmeter
I am building a Voltmeter for a PIC18F using an XC8 compiler on MPLAB and I am having trouble getting my second digit value to update as I rotate my potentiometer. A potentiometer is connected to PORTA, the two digit seven segment display is…

C_GNARWIN
- 13
- 3
0
votes
1 answer
PIC18 UART receiving corrupted bytes from PC
I seem to have issue to receive correct bytes from a PC to a PIC18F27J53.
The PIC UART is set standard, asynchronous, 8bits, 9600, No parity.
The PC is a win 10, I have made a simple UART program, and sending a few ints, all separated by commas,…

random_name1978
- 43
- 4
0
votes
1 answer
DAW Instruction capabilites
I know that the DAW instruction adjusts the 8bit result in the WREG after adding two packed BCD numbers but is the DAW instruction capable of adjusting a much higher bit result in WREG ?

Luis B
- 1
- 5
0
votes
1 answer
I need to reverse the order of LED colors in my board
I need to reverse the order of my LED colors into 'PORT D' from the original sequence in 'PORT B'.
My original colors in 'PORT B' are Blue, Purple, Green, Red, Yellow, Turquoise, White, and no color. Now I need to reverse the order in 'Port D'. I am…

Luis B
- 1
- 5
0
votes
1 answer
PIC18F26Q43 SPI Slave does not receive data
I want two PIC18 to communicate by SPI. The slave has the new SPI module with FIFOs and separate RX and TX registers. For some reason I cannot receive data. I guess I misconfigure the module.
I also use the SS interrupt to prepare the transfer. Upon…

user5717448
- 3
- 4
0
votes
1 answer
Incremental encoder - polling or interrupts?
I took over a project including PIC18f25k80 microcontrollers and incremental encoders. Basically I just need to follow the position of the motor using the encoder, and drive a device to specific locations. I know that there are more methods to read…

Marcell Juhász
- 528
- 3
- 9
0
votes
0 answers
Writing a USB Joystick using PIC and MikroC
I'm using PIC18F2458 as USB Joystick HID. The program works, but I have few problems.
Right now, The USB is not detected If I can't write more than 5 values ( Throttle, X,Y, 4 buttons).
The current problem is If I'm using an analog sensor for the…

andre_lamothe
- 2,171
- 2
- 41
- 74
0
votes
0 answers
pic18f47q43 Reading from program flash memory problem
I am using MPLAB X IDE and MPLAB Code Configurator (MCC).
i generated the library of the flash read/write and erase with MCC.
then when i used "FLASH_ReadPage" built in function created from the MCC its not working, and after debugging i found it…
0
votes
1 answer
Multiple SPI configurations on PIC18
I am using the PIC18f46k42 microcontroller, XC8 2.3, with MPLABX/ MCC. My goal is to use the single SPI hardware peripheral to interface with multiple devices using various GPIO pins as chip selects. I have an LCD and an SD card that both need to…

Chris F
- 101
- 1
- 1
- 6