100% found this document useful (3 votes)
508 views

PIC Microcontroller Hello World, PIC16F1823

This document provides instructions for a "Hello World" program using a PIC16F1823 microcontroller to turn on an LED connected to pin RC3 of the microcontroller. The program organizes the code in program memory at address 0x10, sets the RC3 pin as an output, clears the analog function for RC3, clears the latch for RC3 to write to the pin, and sets RC3 high to turn on the LED in an infinite loop.

Uploaded by

Nolan Manteufel
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
508 views

PIC Microcontroller Hello World, PIC16F1823

This document provides instructions for a "Hello World" program using a PIC16F1823 microcontroller to turn on an LED connected to pin RC3 of the microcontroller. The program organizes the code in program memory at address 0x10, sets the RC3 pin as an output, clears the analog function for RC3, clears the latch for RC3 to write to the pin, and sets RC3 high to turn on the LED in an infinite loop.

Uploaded by

Nolan Manteufel
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

; University of Texas at San Antonio ; EE3463 Microcontrollers 1 ; www.utsa.edu/engineering ; HELLO WORLD with a PIC Microcontroller PIC16F1823. ; www.microchip.

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.

You might also like