Quantcast
Channel: MEL PICBASIC Forum
Viewing all articles
Browse latest Browse all 4745

16F887 hersout doesn't work

$
0
0
Hello everybody,

can someone help me with this problem? Why is this code not working?

CLEAR

;-- 16F887 external OSC @ 20Mhz ------
DEFINE OSC 20
OSCCON = 0 'SET SYSTEM CLOCK SWITCH BIT

;----- Configuration bits ------------------------------------------------
#CONFIG
Line1 = _DEBUG_OFF & _LVP_OFF & _FCMEN_OFF & _IESO_OFF & _BOR_ON
Line2 = _CP_OFF & _MCLRE_ON & _PWRTE_ON & _WDT_ON & _HS_OSC

__CONFIG _CONFIG1, Line1 & Line2
__CONFIG _CONFIG2, _WRT_HALF & _BOR40V
#ENDCONFIG

DEFINE HSER_RCSTA 90h ' Enable Serial PORT
DEFINE HSER_TXSTA 24h ' Enable transmit
DEFINE HSER_SPBRG 129 ' set USART to 9600 baud (when BRGH=1)
DEFINE HSER_CLROERR 1 ' Enable automatic overrun error

ANSEL=0 ' A/D disabled for ANS0 to ANS7
ANSELH=0 ' A/D disabled for ANS8 to ANS13
CM1CON0 = 0 ' Disable comparators
CM2CON0 = 0 ' These default to disabled at POR, but just in case
CM2CON1 = 0
ADCON1 = 7
IOCB = 0
INTCON = 0



Start:

hserout ["hello", 10, 13]

Pause 1000

goto start
end

Viewing all articles
Browse latest Browse all 4745

Trending Articles