PIC Microcontroller Hello World, PIC16F1823
PIC Microcontroller Hello World, PIC16F1823
com ; Nolan Manteufel ; November 19, 2012 ; [email protected] ; This program turns on an LED. ; For assembly on a microcontroller, this is "Hello World". ; By looking at our hardware and checking the datasheet, our LED is connected to RC3. PORTC, 3 INCLUDE "p16f1823.inc" LED EQU 0x03 __CONFIG _CONFIG1, 2FC4 __CONFIG _CONFIG2, 1BFF ORG 0x0000 ; Program starts here when you power up. nop goto start ORG 0x0004 ; Program goes here if an interrupt occurs. nop goto start ORG 0x0010 ; Organizes the following code at 0x10 in program memory. nop start BANKSEL BCF BANKSEL BCF BANKSEL BCF BANKSEL BCF BANKSEL BSF goto end PORTC PORTC, LED LATC LATC, LED ANSELC ANSELC, LED TRISC TRISC, LED PORTC PORTC, LED $-1 ; ; ; ; ; ; ; ; ; ; ;
Latch the PORT bit to the pin. The the LED pin to digital I/O. The the LED pin to output. Turn the LED on. An infinite loop.