

TRISD = 0x0 // set all port bits to be outputĢ016-2017 Microchip Technology Inc. LATD = LEDS_ON_OFF // write to port latch - RD = LED ( ) TRIS TRISD TRISB01 D 4 2016-2017 Microchip Technology Inc.ġ.3 LED LED (LEDS_ON_OFF) : (LED D1D3D5D7 ONLED D2D4D6D8 OFF)Explorer 8 Development Board Users Guide(DS40001812) B.4Explorer 8ĪNSELD = 0x0 // set to digital I/O (not analog) I/O (PORT) (LAT) LATD LATBLEDS_ON_OFF D

MPLAB XC8 Installation Directory/docs/chips Port B access ANSELB = 0x0 // set to digital I/O (not analog) TRISB = 0x0 // set all port bits to be output LATB = LEDS_ON_OFF // write to port latch - RB = LED return }Ģ016-2017 Microchip Technology Inc. CONFIG2#pragma config WRT = OFF // Flash Memory Self-Write Protect off#pragma config PPS1WAY = ON // PPS one-way control enabled#pragma config ZCDDIS = ON // Zero-cross detect disabled#pragma config PLLEN = OFF // Phase Lock Loop disable#pragma config STVREN = ON // Stack Over/Underflow Reset enabled#pragma config BORV = LO // Brown-out Reset low trip point#pragma config LPBOR = OFF // Low-Power Brown Out Reset disabled#pragma config LVP = OFF // Low-Voltage Programming disabledĪNSELD = 0x0 // set to digital I/O (not analog) TRISD = 0x0 // set all port bits to be output LATD = LEDS_ON_OFF // write to port latch - RD = LED
#Trisd mplab xc8 code#
CONFIG1#pragma config FOSC = ECH // External Clock, 4-20 MHz#pragma config WDTE = OFF // Watchdog Timer (WDT) disabled#pragma config PWRTE = OFF // Power-up Timer disabled#pragma config MCLRE = ON // MCLR/VPP pin function is MCLR#pragma config CP = OFF // Flash Memory Code Protection off#pragma config BOREN = ON // Brown-out Reset enabled#pragma config CLKOUTEN = OFF // Clock Out disabled.#pragma config IESO = ON // Internal/External Switchover on#pragma config FCMEN = ON // Fail-Safe Clock Monitor enabled For more on Configuration Bits, // consult your device data sheet
