Hi,
I want to implement a project using the PIC16F88.
As a start and for needed indications later a want to lit up a led
and it doesn't work properly.
I'm using a PICKIT3 for programing and I have managed to program a PIC16F877
for another program.
I tried various variations of turning on/off and flickering led commands.
In all the cases the led (bi-colored) responded after a long time (~30 sec)
and turned off and on randomly. The mplab software messages inform
of no errors and of successful programing.
The led works well when not connected to the PIC.
What can the problem by?
I'm attaching the recent code
Thanks, Amitai
I want to implement a project using the PIC16F88.
As a start and for needed indications later a want to lit up a led
and it doesn't work properly.
I'm using a PICKIT3 for programing and I have managed to program a PIC16F877
for another program.
I tried various variations of turning on/off and flickering led commands.
In all the cases the led (bi-colored) responded after a long time (~30 sec)
and turned off and on randomly. The mplab software messages inform
of no errors and of successful programing.
The led works well when not connected to the PIC.
What can the problem by?
I'm attaching the recent code
Thanks, Amitai
Code:
LIST P=PIC16F88
include <P16f88.inc>
org 0x00
__CONFIG _CONFIG1, _LVP_OFF &_WDT_OFF &_PWRTE_OFF &_CP_OFF & _INTRC_IO
reset:
nop
goto start
org 0x20
start:
; CONFIGURATION*-*-*-*-*-*-*-*-*-
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
; used_ registers:
MUX_sel EQU H'0021' ; MUX select value
del1 EQU H'0030' ; for delay
del2 EQU H'0031' ; for delay
to_transmit EQU H'0050' ; data register
led1 EQU H'0070' ; for led delay
demo_tr EQU H'0072' ; demo transmit
loop_mux EQU H'0074' ; demo transmit
; oscillator
banksel OSCCON ; 8M internal clk, mode defined
movlw 0b01111000 ; by fosc(2:0), ??????
movwf OSCCON ; system clock source from main oscillator
; led
BANKSEL PORTB
CLRF PORTB
banksel ANSEL ; Configure all pins as digital inputs
clrf ANSEL
banksel TRISB
clrf TRISB ; make PORTB output
; MAIN PROGRAM*-*-*-*-*-*-*-*-*-*
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Led_flicker:
banksel PORTB
bsf PORTB,3
bcf PORTB,2
;---end Led flicker
; END MAIN PROGRAM*-*-*-*-*-*-*-*-*-*
;*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
end