Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16f72 PORTA not going to be digital output completely. RA4 not going high.

Status
Not open for further replies.

d4dany

Newbie level 1
Joined
Nov 10, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Pakistan
Activity points
1,291
RA4 not turn on the led. other leds are on.


Code ASM - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
processor               PIC16F72
#include                <p16F72.inc>
__Config                _XT_OSC & _WDT_OFF & _PWRTE_ON
 
org             0x00
banksel         PORTA
movlw           0x00
movwf           PORTA
movwf           PORTB
movwf           PORTC
banksel         ADCON1
movlw           b'00000110'
movwf           ADCON1
movlw           0x00
movwf           TRISA
movwf           TRISB
movwf           TRISC
movlw           b'11111111'
banksel         PORTA
movlw           0xff
movwf           PORTA
movwf           PORTB
movwf           PORTC
 
main
goto main
end

 
Last edited by a moderator:

hexreader

Advanced Member level 2
Joined
Apr 7, 2011
Messages
537
Helped
194
Reputation
392
Reaction score
196
Trophy points
1,323
Location
England
Activity points
4,827
RA4 has an open drain output. It is different to the other port outputs.

Check out the IO ports section of the datasheet.
 

Jestin_cubetech

Advanced Member level 1
Joined
Jun 24, 2012
Messages
499
Helped
76
Reputation
152
Reaction score
73
Trophy points
1,328
Activity points
3,697
you can Drive a LED

RA4---/\/\/\/\-------|<|----- VCC
................. 330E......K.. LED....A.....
 

Tahmid

Advanced Member level 5
Joined
Jun 17, 2008
Messages
4,758
Helped
1,791
Reputation
3,574
Reaction score
1,650
Trophy points
1,393
Location
Silicon Valley, California, USA (from Dhaka, Bangl
Activity points
30,545
Like mentioned above, RA4 is open-drain. So, you can't get a high output. You get either low (0) or a floating state. To get high (1) output, you need to pull-up the pin to VDD level, so that, instead of the floating state, you now get a high output (due to the pull-up resistor). A 10k resistor is sufficient. However, you can't draw much current due to the pull-up resistor. In that case, you may use a transistor.

Hope this helps.
Tahmid.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top