Started trying to get USART going on the LAB X1, but was getting garbage - couldn't figure it out, so I moved to a breadboard and started at the beginning. It doesn't get much more basic than this on a 16F877; blinky on pin D1.
Code:
#CONFIG
__config _HS_OSC & _WDT_OFF & _WRT_OFF & _BODEN_ON & _LVP_OFF & _CPD_OFF & _PWRTE_OFF & _DEBUG_OFF
#ENDCONFIG
DEFINE OSC 20
ADCON1 = 7 ' A/D off, all digital
TRISD = %00000000
PORTD = %00000000
START: PORTD = %00000000
PAUSE 500
PORTD = %00000010
PAUSE 500
GOTO START
Finish: end
Compiled using PK4 successfully:
Code:
DFP Version Used : PIC16Fxxx_DFP,1.4.149,Microchip
*****************************************************
Connecting to MPLAB PICkit 4
Currently loaded versions:
Application version...........00.09.46
Boot version..................01.00.00
Script version................00.05.58
Script build number...........abbfe90327
Tool pack version ............1.15.1688
Target voltage detected
Target device PIC16F877 found.
Device Revision Id = 0x6
Device Id = 0x9a0
*****************************************************
Erasing...
Erase successful
*****************************************************
Erasing...
The following memory area(s) will be programmed:
program memory: start address = 0x0, end address = 0x1fff
EEData memory
Programming/Verify complete
Program Report
01-May-2023, 17:01:53
Device Type:PIC16F877
Program Succeeded.
PK4 Verify Report
01-May-2023, 17:01:53
Device Type:PIC16F877
*****************************************************
The following memory area(s) will be verified:
program memory: start address = 0x0, end address = 0x1fff
EEData memory
Verification successful.
Verify Succeeded.
- I added two power LEDs at the top to show both rails are powered.
Blinky LED is on pin D1, and yet nothing happens.
LED comes on if I manually apply 5V to pin.
I've changed 20MHz OSC and caps.
Changed MCU.
I've been trying to figure this out for waaaay too long now, I feel I'm getting dumber by the minute.
Robert

EDIT: For a sec I thought my CONFIG was obsolete, but that looks ok.
Bookmarks