The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.
Questions tagged [pic18]
230 questions
0
votes
2 answers
Using structure/union combinations
I am using c programming in PIC18F87K90 microcontroller. I am having a problem about creating a structure variable (with union within it) to have an easier access to multiple flags (most are 1-bit flags, but some are 2-bit or 3-bits).
The code below…

user139731
- 129
- 5
0
votes
1 answer
How to understand the TCP option field I received on my PIC18?
My goal is to exchange packets between my PIC18F67j60 microcontroller (it has a Ethernet module) and my host computer.
I programmed the PIC18F using MPLABX IDE (C language, pickit3) and on the computer side, I programmed a simple application on…

Idash
- 55
- 8
0
votes
0 answers
PIC18 XC8 Bootloader not mapped to correct address
I'm writing a bootloader for a PIC18F87K22. I used the -mrom command line argument recommended in their documentation/webinar to limit the Range that the compiler would place things into ROM between 0x0000-0x0FFF which should give me 4K to write the…
user545199
0
votes
0 answers
Did someone manage to write application program at a specific offset in PIC18F program memory using MPLAB v.8.92 IDE (C18 compiler)?
I've been stuck for a little while now. I am using a PIC18J67j60 with MPLAB IDE (8.92).
My goal is to write my application (application works fine) at the address 0x2A in the PIC18 program memory.
To do so, I added the 18f67j60_g.lkr linker script…

Idash
- 55
- 8
0
votes
1 answer
How can I make the PWM functionality on my PIC18F24Q10 work properly?
I am new to working with PIC microcontrollers and MPLAB. I bought myself a few PIC18F24Q10 chips and have slowly figuring out how to use some of the different functionalities. One thing that I am currently stumped on is the PWM. I have been trying…

logan1213141
- 11
- 1
0
votes
1 answer
PWM on a PIC18 using CCP4
I'm having trouble setting up PWM on my PIC18F45K22. I can get it working on CCP1 using timer2 but I would like to use CCP4 and timer4 as I plan to use CCP1 and timer2 elsewhere.
I am coding in assembly (mpasm v5.87). I am not sure why it won't on…

Jason Kamps
- 1
- 1
0
votes
1 answer
PIC18F97J60 Increment FSR not affecting INDF
; point FSR0 to address 0x0 and set INDF to 'A'
movlw 0x0
movwf FSR0
movlw A'A'
movwf INDF0
; increment FSR0, then set new INDF to 'B'
incf FSR0
movlw A'B'
movwf INDF0
; decrement FSR0, then…

FeoniX
- 11
- 2
0
votes
1 answer
Dynamic PWM duty cycle
I cant change the duty cycle of the PWM dynamically. I found this in the datasheet that I might be misinterpreting:
CCPR1L and CCP1CON<5:4> can be written to at anytime, but the duty cycle value is not copied into CCPR1H until a match…

Marvinatorrr
- 103
- 1
- 3
- 15
0
votes
1 answer
Unable to use Curiosity HPC on MPLABX (PKOB), how can I get it to work on current IDE?
I've just installed MPLAB X IDE v5.30 on my computer, connected a Curiosity HPC development board, which has an integrated programmer (PICkit-on-board, PKOB), and tried to use it on a project, however, on the project settings menu, the board is…

NeonMan
- 623
- 10
- 24
0
votes
1 answer
Uart1 & Uart3 not working at same time in pic18fk67k40
I am using PIC18f67k40 with internal clock at 8Mhz (IDE 7.5).
I did led blinking and simple UART1 transmit that works fine.
Next while trying UART1 & UART3 at same time, only UART1 works... (UART1 init first then UART3 init)
if i changes init order…

Ram Shivas
- 1
- 1
0
votes
1 answer
Digital clock with 7 segment display with pic18f445k22
could someone please help me?
I wrote the code bellow, to run a digital clock, but when i simulate in proteus the led only blink and the display only show 00:00, and it never count. I used timer 0 and timer 1 to generate 1 sec of delay
ANy…

Ntampata
- 1
- 1
0
votes
1 answer
Having trouble of drawing hands of an analog clock
I have an assigment to make an analog clock in C PIC18 starter kit.
I need to draw all the hands of the clock, aka seconds, minutes and hours.
I have initialized all 60 points of the clock diamater in a 2D array with x and y values and have the…

Play38
- 115
- 1
- 11
0
votes
1 answer
PIC18 Read/Write to data when split across ports
Due to design limitations, I have an address line for a memory controller split across 3 different ports of a PIC 18F4550.
Mapping:
#define A0 PORTBbits.RB2
#define A1 PORTBbits.RB3
#define A2 PORTBbits.RB4
#define A3 PORTBbits.RB5
#define A4…

Ali Lown
- 2,323
- 1
- 18
- 22
0
votes
1 answer
How to detect the start of an ICSP session?
My board can be started with a blank pic and programmed through ICSP without problems but while running, the start of a programming session may lead to dangerous behavior.
How can I detect the start of a programming cycle and execute some code to…

pickit123
- 1
- 1
0
votes
1 answer
How to receive IR signal in PIC18F
I need to receive signal from IR transmitter LED. I am not sure how to program the microcontroler. I am looking for some concept, how to do that. Whether I have to use A/D conversion? How to synchronize transmitter and receiver? What structure will…

sennin
- 8,552
- 10
- 32
- 47