Page 1 of 1

How to program this PIC Microcontroller using C language?

PostPosted: Wed Mar 22, 2017 9:45 am
by Renessme
Hi dear members,
I am new to microcontroller programming. I want to program PIC16F18345 microcontroller using C language on MPLABX IDE, XC8 compiler.
PIC 16F18345 as a Embedded - Microcontroller was manufacturered by Microchip Technology. Maybe you have already know this.
Here are some Specifications of PIC 16F18345 microcontroller :

Operating-Temperature: -40°C ~ 85°C (TA)
Supplier-Device-Package: 20-SOIC
Number-of-I-O: 18
Speed: 32MHz
EEPROM-Size: 256 x 8
Core-Processor: PIC
RAM-Size: 1K x 8
Program-Memory-Type: FLASH
Peripherals: Brown-out Detect/Reset, POR, PWM, WDT
Connectivity: I2C, LIN, SPI, UART/USART
Voltage-Supply-Vcc-Vdd: 2.3 V ~ 5.5 V
Core-Size: 8-Bit
Program-Memory-Size: 14KB (8K x 14)
Data-Converters: A/D 17x10b, D/A 1x5b
Oscillator-Type: Internal

Please let me know good online tutorial where I can learn to program above said microcontrller in C language. I mean how to add headers, which header for what purpose and how to add libraries and what all libraries are available. I also need example sample program for pic16F18345(

One example, if i need to compile a program with pointer, an array what all needs to be done on mplabx ide selecting pic16f18345.

Code: Select all
int a[5]={1,2,3,4,5};
void main(void)
int *p,i;

In the same way, how to write complex program? Please let me know the tutorials.
Thanks & regards,

Re: How to program this PIC Microcontroller using C language?

PostPosted: Thu Oct 05, 2017 7:36 am
by op@tmm
This site seems to use XC8 in its tutorials: ... tutorials/ Not the same PIC though but I don't think there's much difference. The author used a pointer in the last code on ... ic16f877a/ and you'll see it's still the same C way of using pointers.