The PIC18 series 8 bit microcontrollers manufactured by Microchip Technology.
Questions tagged [pic18]
230 questions
3
votes
2 answers
How to unit-test a bootloader on PIC18 with TCP/IP stack used?
I am developing a bootloader using the XC8 C compiler 1.12 in MPLAB X 1.60 from Microchip. The target chip is PIC18F87J60.
My bootloader does some extra things bootloaders normally don't do. It downloads the app image to flash from a server and…

Jupiter
- 1,421
- 2
- 12
- 31
3
votes
1 answer
Microchip TCP/IP stack PIC18F invalid packet seq/ack numbers
Dear fellow StackOverflowers,
Im working on a project to implement something on the PIC18F87J60 on my custom (and tested) board using the TCP/IP stack from Microchip. As a test I wrote some code to setup a connection, maintain it for x seconds and…

Jupiter
- 1,421
- 2
- 12
- 31
3
votes
3 answers
Delay on PIC18F
I'm using a PIC18F14K50 with HiTech ANSI C Compiler and MPLAB v8.43. My PIC code is finally up and running and working, with the exception of the delay function. This is crucial for my application - I need it to be in certain states for a given…

Ozzah
- 10,631
- 16
- 77
- 116
2
votes
4 answers
parsing ip adress string in 4 single bytes
I'm programming on a MCU with C and I need to parse a null-terminated string which contains an IP address into 4 single bytes. I made an example with C++:
#include
int main()
{
char *str = "192.168.0.1\0";
while (*str != '\0')
…

BETSCH
- 104
- 2
- 3
- 8
2
votes
2 answers
PIC C18: Reading bits from a byte
I have a very elementary question. However, what ever I tried, I couldn't successfully implement this.
I have a shift register (74LS164) connected to PIC18F2550 with the following hardware configuration:
// Data pin
#define SCLCD_DATA …

hkBattousai
- 10,583
- 18
- 76
- 124
2
votes
1 answer
from PIC18f4550 to serial in parallel out latch
I searched alot about how to send data from PIC18f4550 to 8-bit serial-in, serial or parallel
74HC595 latch.
I need a code example to understand how the operation can be performed.
Any help is appreciated.

user1077980
- 155
- 1
- 3
- 15
2
votes
1 answer
PIC programming which bits are which in TRIS register
I am trying to understand PIC18 code in a format like TRISB &= 0b11100000.
What is the order the individual RB pins appear in? i.e. is this register setting RB0-RB2 as input, or RB5-RB7 as input?

Cheetaiean
- 901
- 1
- 12
- 26
2
votes
1 answer
MPLAB gives Low power and device failed to connect error when programming pic18f25q10
I am trying to add a simple led application to a PIC18F25Q10 in another circuit using the Curiosity HPC development board. I am using the MCLR, PGD, PGC and GND pins. Although I set the LVP mode to enable in the CONFIG settings and the program speed…

fthelb
- 23
- 5
2
votes
1 answer
Gated Timer on PIC18 sets TMR3IF flag to late & with Fosc/4 it doesn't set it anyway
I have already spent several nights debugging gated timer on PIC18F26K80. I use MPLAB v4.15 and XC8 v2.32. I want to run a long period timer, so I chose Timer 3 gated by Timer 4. I've read Microchip's documentation and tried to find answers…

OndraCER552
- 31
- 5
2
votes
1 answer
Sending TABLAT value to a port gives me the wrong value
I'm trying to write a program on PIC18F4550 where I have data defined in my memory and want to send it to PORTC character by character. I have done so but the values showing on PORTC are not the ones shown in the TABLAT register. For example, in my…

April Crude
- 117
- 7
2
votes
1 answer
Problem calling in PIC C18, parameters garbled - using pointers to structures perhaps?
I am trying to make a fairly simple call using PICC18.
Using the MPLAB simulator I am seeing the arguments, even on entry to the function, being completely garbled.
I have the following typedef
typedef struct
{
// t_ax25AddressChar…

Richard Corfield
- 717
- 6
- 19
2
votes
2 answers
How to place variables in the access bank - PIC 18 MPASM linker script
I have a linker script which starts
INCLUDE 18f14K50_g.lkr
I want my interrupt service variables to go into the ACCESS bank. (My program's so small at the moment the whole lot can, but maybe in future...). So
SECTION NAME=VarsModemISR …

Richard Corfield
- 717
- 6
- 19
2
votes
1 answer
How can i approach this program with creating a Boolean variable instead of cycling through branches?
I am programming a PIC1847q processor on the curiosity HPC board. My task is to design a battlestar galactica cyclon visor using the LEDs on the board. My current code does infact create and replicate the Cyclon, but I do not think the logic is…

Max Sorin
- 21
- 2
2
votes
1 answer
Issue in interfacing SPI e-ink display with PIC 18F46K22
I am using a PIC 18F46K22 in SPI master mode to communicate with a Waveshare 1.54" ePaper Module. The FOSC frequency is 8Mhz internal and SPI configuration is FOSC/4. So when I check the output on logic-analyzer some output bits are differ from…

Naman Shandilya
- 21
- 2
2
votes
2 answers
What is a normal interrupt latency and context saving time on Microchip C18?
I am using the Microchip C18 compiler and on occurrence of an interrupt I am experiencing a quite long delay before the ISR code starts running.
As an experiment, this is in my main function:
while(1)
{
LATAbits.LATA4 = 1;
LATAbits.LATA4 =…

AndreKR
- 32,613
- 18
- 106
- 168