ckchan,
You also need to initialize the A/D converter.
Try this:
MAIN
clrf PORTD ; initialize port d
bcf ADCON0,0 ;Turn A/D module OFF!!
bsf STATUS,RP0 ; select bank
movlw B'00000000' ; set port d as output pin
movwf TRISD ;
movlw b'00000110'
movwf ADCON1 ;All A/D channels Digital I/O!!
bcf STATUS,RP0 ; de-select bank
movlw 0H ; default low to port d
movwf PORTD ;
;
Then continue on doing whatever you were doing.
Hope this helps!
Best regards,
Steve
Steven Kosmerchock
Father/Student/Engineering Technician
www.geocities.com/researchtriangle/lab/6584
"Great spirits have always encountered violent
oppposition from mediocre minds."--A.Einstein
-----Original Message-----
From: ckchan [mailto:ckchan4@PC.JARING.MY]
Sent: Tuesday, March 28, 2000 8:02 AM
To: PICLIST@MITVMA.MIT.EDU
Subject: help on PIC16F874
Greetings,
i really need some help here. been debuging for 2 days ! :O please tell
me what's wrong with this short code. it's to make a LED blink. that's
all. i tried the delay routine on PIC16F84, it's working. the LED blink
! but not with PICF874. The LED will ON permenantly. any configuration i
missed out ? Thanks !
regards,
ckchan