I've narrowed it down to USB logic. I probably have something out of date.
The LCD and blinky on lower bits of Port D work fine.
Code:#CONFIG CONFIG PLLDIV=5, CPUDIV=OSC1_PLL2, USBDIV=2, FOSC=HSPLL_HS CONFIG PWRT=OFF, BOR=ON, BORV=1, VREGEN=ON, WDT=OFF CONFIG CCP2MX=ON, PBADEN=OFF, LPT1OSC=OFF, MCLRE=ON CONFIG STVREN=ON, LVP=OFF, ICPRT=OFF, XINST=OFF #ENDCONFIG DEFINE OSC 48 INCLUDE "ALLDIGITAL.pbp" ; Set all pins as digital ADCON1 = %00001111 ; A/D Control INTCON2 = %00000000 ' Using only 4 bit bus to control LCD DEFINE LCD_DREG PORTD ' Set LCD data port DEFINE LCD_DBIT 4 ' Set starting data bit DEFINE LCD_RSREG PORTE ' Set LCD register select port DEFINE LCD_RSBIT 0 ' Set LCD register select bit DEFINE LCD_EREG PORTE ' Set LCD enable port DEFINE LCD_EBIT 1 ' Set LCD enable bit DEFINE LCD_BITS 4 ' Set LCD bus size DEFINE LCD_LINES 2 ' Set number of lines on LCD DEFINE LCD_COMMANDUS 1000 ' Set command delay time in microseconds DEFINE LCD_DATAUS 50 ' Set data delay time in microseconds TRISA = %00000000 TRISB = %00000000 TRISC = %00000000 TRISD = %00000000 TRISE = %00000000 ProgramStart: PAUSE 1500 LCDOUT $FE,1,"LabX1 18F4550 USB" ProgramMain: PORTD = %00001010 PAUSE 500 PORTD = %00000101 PAUSE 500 GOTO ProgramMain END



Bookmarks