What to create microcontroller application without writing any code? Keep reading…
Let’s create a project. It would be again Blinking LED demo.
Open MPLAB X IDE, and go to File -> New Project.
– Microchip Embedded; Standalone Project
– Family: Mid-Range 8-bit MCUs (PIC10/12/16/MCP); Device: PIC16F1619
– Supported Debug Header: None
– Select Tools: Microchip Starter Kit [-> Curiosity (if it’s plugged in)]
– Select Compiler: XC8 (v…)
– Project name NoHands1619
– Finish
Don’t create any source code files but click on MCC button.
– Change Internal Clock to 8MHz
– Open ‘Pin Manager: Grid View’ and switch package to PDIP20
– Enable following GPIO as Output – Port A: 1, 2, 5; Port C: 5
– Switch to Pin Module tab and change names for pins and make sure they are Output and not marked as Analog
– After that click on Generate button
Now go back to Projects page -> Source Files and open main.c
and add following code inside while(1) loop:
while (1)
{
LED1_LAT = !LED1_PORT;
LED2_LAT = !LED2_PORT;
LED3_LAT = !LED3_PORT;
LED4_LAT = !LED4_PORT;
__delay_ms(1000);
}
We are done!!!
If your Curiosity board is plugged in click on Make and Program Device Main Project,
for light should start blinking.