I will try those ideas, Bruce.
Got to wondering if the MCU was actually running. I can see from the PRG light on the EasyPic6 it is getting programmed but in previous code didn't have any way to confirm it was actually running....if it weren't that could explain why the test LEDs didn't light in previous post and also possibly why the HSERIN and HSEROUT statement aren't executing...hence no communications.
I inserted a blinking LED in the loop in the below version and when I run it, it doesn't blink...indicating the MCU is not running!! Now I don't know what to do to make the MCU run.?????
Code:
ASM ; 18F2550/4550, 8mhz crystal
__CONFIG _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC4_PLL6_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_OFF_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
__CONFIG _CONFIG3H, _PBADEN_OFF_3H ; PortB resets as digital
__CONFIG _CONFIG4L, _LVP_OFF_4L & _XINST_OFF_4L
ENDASM
Include "Modedefs.Bas"
INCLUDE "ALLDIGITAL.pbp" ' Sets all registers for digital ops.
' User must make sure the AllDigital.pbp file
' is in same directory location as this source
' code before compiling.
DEFINE OSC 16
TRISB = %00001111 ' Set PORTB.4,5,6,7 to outputs as test LEDs
ADCON1 = 15 ' All I/O pins digital
PORTB.5 = 0
PORTB.6 = 0 ' Turn off the LEDs
PORTB.7 = 0
X VAR BYTE
START:
PORTB.5 = 1 ' Blink LED as test that MCU is running
RCSTA.4 = 0 : RCSTA.4 = 1
RCSTA=$90:TXSTA=$20:SPBRG=25
HSERIN [DEC X]
PORTB.6 = 1 ' Turn on PortB.6 LED if this statement is executed
' as test of receiving a character
HSEROUT [DEC X,$d,$a]
PORTB.7 =1 ' Turn on PortB.7 LED if this statement is executed
' as test of HSEROUT having sent a character
PORTB.5 = 0
GOTO START
Bookmarks