low voltage at pic 16f84 high output pin

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
saravana_3
Posts: 61
Joined: Thu Dec 20, 2007 4:23 pm
Location: singapore
Contact:

low voltage at pic 16f84 high output pin

Post by saravana_3 »

Dear friends,
I am using the Hp-488-00-3 development kit, I wrote the program in Pic16f84, the condition is when the low input in the RB0,and RB3 and there is no inturrupt (RB4,Rb5,RB6,Rb7) should give high output at RA0, when there is high input in the RB3 it would give the low output at the RA0. I have to do it for Rb1and RB2 also,after I download the program into the chip the RA0 is lights up but the voltage at the pin 17 is 0.6 volts,this is happend before include the inturrupt in my program, when I add the RB1 the output vlotage in both pins are 0.3v, when I add the RB2 the voltage at the three pins are 0.2v, is it the hardware problem or the coding problem, when I include some delay the output voltage is high (4.5v), but the program is not functioning as per my design, I have bypass the delay using the ';'
below I have given my coding for the RB0, if it is the coding problem please correct for me
thanks
; Desc: 1.standby input is high
; 2.U1 has the highest priority, U3 has the lowest priority
; 3.selected input is low
; 4.selected input will be come to output only if the PTT is selected(ie) the PTT is low
; and the reference 'R' is low
; 5.Input is low and the output is high
;'R' is used as the inturrupt (RB4,RB5,RB6 and RB7)
; NOTE: Tested on PIC16F84-04/P.
list p=16F84
radix hex
org 0x000
;----------------------------------------------------------------------
; cpu equates (memory map)
Status equ 0x03
portA equ 0x05 ; define the portA address
portB equ 0x06 ;
Output_Status equ 0x08 ;
count1 equ 0xA0
count2 equ 0xA1
INTCON equ 0x0B ;Interrupt Control Register
TEMP equ 0x0d ;Temporary store for w register
;----------------------------------------------------------------------
;-----initialise PortB and Output_Status-------------
movlw 0x00
movwf portA
movwf Output_Status
;-----------------------------------------------------
goto Start
;================================================================
org 0x04 ;This is where PC points on an interrupt

movwf TEMP ;Store the value of w temporarily

movlw b'00000000'
movwf portA

bcf INTCON,0 ;We need to clear this flag to enable
movfw TEMP ;Restore w to the value before the interrupt
RETFIE ;Come out of the interrupt routine
;============================================================================
Start
Initialise movlw 0xFF ; load W with 0x00 make port B output (p. 45)
tris portB ; copy W tristate to port B outputs (p. 58)

movlw 0x00 ; load W with 0xFF make port A input
tris portA ; copy W tristate to port A
bsf INTCON,7 ;GIE – Global interrupt enable (1=enable)

bsf INTCON,3 ;INTE - RB0 Interrupt Enable (1=enable)

bcf INTCON,0 ;INTF - Clear FLag Bit Just In Case
;---------------------------test portB_1--------------------------------
Test_Bit1
BTFSC portB,0
goto Test_Bit2

BTFSC Output_Status,1
goto Clear_BitB1

BTFSC portB,3
goto Clear_BitB1

;---A4 pressed------------------------------------------------------------------
Set_BitB1
bsf portA,0
bsf Output_Status,1
;goto wait_to_Resease_A0
;---A4 Not pressed---
Clear_BitB1
bcf portA,0
bcf Output_Status,1
;goto wait_to_Resease_A0
;-------------------------------------------
;wait_to_Resease_A0
; BTFSS portB,0
; goto Test_Bit2
; goto wait_to_Resease_A0
Test_Bit2
goto Start
end
saran

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: low voltage at pic 16f84 high output pin

Post by Benj »

Hello Saran

You can now attach your code to the forum post or you can email me with your code.

It sounds like the Output pin is switching on and off at high speed. This explains the 0.2V being measured.

Post Reply