amitaiwe
Member level 3
- Joined
- Feb 19, 2014
- Messages
- 57
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Activity points
- 547
Hi to all,
I’m trying without success to drive an output from a PIC16F877.
No matter what I did the wanted port pins stay on a logic ‘0’ v…
I have in my disposable 3 PIC’s (and I tried the 3 of them), a picKit3 set
And a uniform led (ltl 30hju). I have tried several things including WDT en/disabled, connecting resistors to the led , changing the output port and verifying Led operation.
The input voltage is 5v and so is the output of various (untouched) pins.
When I wire and connect the PIC to the PIC there are no errors provided from
The IDE (8.9) and all the notifications of compilation and programing seem ok.
So, as it seems the problem is some connection/wiring error which I did but I don’t manage go figure it out. Any idea what’s missing?
Basically I want to get an indication that the pic works properly and for that prepares.
I’m using this code:
Thanks in advance, Amitai
I’m trying without success to drive an output from a PIC16F877.
No matter what I did the wanted port pins stay on a logic ‘0’ v…
I have in my disposable 3 PIC’s (and I tried the 3 of them), a picKit3 set
And a uniform led (ltl 30hju). I have tried several things including WDT en/disabled, connecting resistors to the led , changing the output port and verifying Led operation.
The input voltage is 5v and so is the output of various (untouched) pins.
When I wire and connect the PIC to the PIC there are no errors provided from
The IDE (8.9) and all the notifications of compilation and programing seem ok.
So, as it seems the problem is some connection/wiring error which I did but I don’t manage go figure it out. Any idea what’s missing?
Basically I want to get an indication that the pic works properly and for that prepares.
I’m using this code:
Code:
LIST P=PIC16F877
include <P16f877.inc>
org 0x00
reset: goto start
org 0x04
start: bcf STATUS, RP1
bsf STATUS, RP0 ;bank 1
clrf TRISD
bcf STATUS, RP0 ;bank 0
movlw 0x01
movwf PORTD
LOOP:
rlf PORTD, f
call DELAY
call DELAY
call DELAY
call DELAY ; delay * 4
goto LOOP
DELAY
movlw 0xff ; N1
movwf 0x30
cont2: movlw 0xff ; N2
movwf 0x31
cont1: decfsz 0x31,1
goto cont1
decfsz 0x30,1
goto cont2
return ; D=(5+4N1+3N1N2)*200nsec = (5+4*255+3*255*255)*200ns = 39.22ms
end
Thanks in advance, Amitai
Last edited by a moderator: