0013: 1683 BSF 3,5
0014: 30FF MOVLW 0FFh
0015: 0085 MOVWF 5
0016: 0086 MOVWF 6
hi everyone, problem solved! i connected a wire from the pic's vdd pin to the connector's vdd and it worked. it was kind of a desperate measure, but it worked. now i have another problem hahaha i extracted an hex file from the pic's memory (which i converted to asm, and doing the best to understand how it works) but i don't know where to get information regarding pin configuration. on the hex file i extracted from the pic it doesn't appear...
bit 5 and 6 would be inputs? any advice to do a better disassembly? I'm kind of lost with this code. i can send you the hex file if you prefer
bit 5 and 6 would be inputs? any advice to do a better disassembly? I'm kind of lost with this code. i can send you the hex file if you prefer
all pins will be inputs? all pins of the pic? all pins of a certain port?
this pic is mounted on a pcb board along with a lattice fpga device, they control the duty cycle of a motor. from pins 18 and 19 (RC1 and RC2 - PIC16f877 plcc) you get a 50% and a 25% duty cycle respectively (i have checked this with an oscilloscope). the thing is, that i want to understand how the program works because i want to add to more outputs, one with 75% and another with 100% duty cycle.
so, the 25% and 50% are a function of the pic device? i know that these are PWM outputs, but then the duty cycles are (according to the program) in no way controlled by the pic? the pic already comes with those %s?
; Generated by WinPicProg 1.95f, (c) Nigel Goodwin June 2006.
LIST P=16F877, F=INHX8M
include "P16F877.inc"
__CONFIG 0x3B39
; Variable definitions
ORG 0x0000
GOTO Label_0001
ORG 0x0004
GOTO Label_0002
Label_0002 NOP
RETFIE
Label_0003 BCF STATUS , RP0
CLRF CCPICON
CLRF TMR2
BSF STATUS , RP0
MOVLW 0x31
MOVWF PR2
BCF STATUS , RP0
MOVLW 0x0C
MOVWF CCPRIL
MOVLW 0x19
MOVWF CCPR2L
CLRF INTCON
BSF STATUS , RP0
MOVLW 0xFF
MOVWF TRISA
MOVWF TRISB
MOVWF TRISC
MOVWF TRISD
MOVWF TRISE
BCF TRISC , 02
BCF TRISC , 01
CLRF PIE1
BCF STATUS , RP0
CLRF PIR1
MOVLW 0x2C
MOVWF CCPICON
MOVWF CCP2CON
CLRF T2CON
BSF T2CON , TMR2ON
RETURN
Label_0004 CLRWDT
RETURN
Label_0001 CALL Label_0003
Label_0005 CALL Label_0004
GOTO Label_0005
ORG 0x2000
DATA 0xFF
DATA 0x3F
DATA 0xFF
DATA 0x3F
END
what i mean, is that what "i" control through the pic program is the %duty cycle of the outputs. for example, i could change the 25% for a 75%... but these outputs are one of the pic's functions, what i, as a user decide is the %, right?
(sorry for being so slow to understand...)
; Generated by WinPicProg 1.95f, (c) Nigel Goodwin June 2006.
LIST P=16F877, F=INHX8M
include "P16F877.inc"
__CONFIG 0x3B39
; Variable definitions
ORG 0x0000
GOTO Label_0001
ORG 0x0004
GOTO Label_0002
Label_0002 NOP
RETFIE
Label_0003 BCF STATUS , RP0
CLRF CCPICON
CLRF TMR2
BSF STATUS , RP0
MOVLW 0x31
MOVWF PR2 ; why PR2? 0x12 is T2CON right?
BCF STATUS , RP0
MOVLW 0x0C
MOVWF CCPRIL
MOVLW 0x19
MOVWF CCPR2L
CLRF INTCON
BSF STATUS , RP0
MOVLW 0xFF
MOVWF TRISA
MOVWF TRISB
MOVWF TRISC
MOVWF TRISD
MOVWF TRISE
BCF TRISC , 02
BCF TRISC , 01
CLRF PIE1 ;why are these two lines
BCF STATUS , RP0
CLRF PIR1 ; different if they are both
CLRF 0xC
MOVLW 0x2C
MOVWF CCPICON
MOVWF CCP2CON
CLRF T2CON
BSF T2CON , TMR2ON
RETURN
Label_0004 CLRWDT
RETURN
Label_0001 CALL Label_0003
Label_0005 CALL Label_0004
GOTO Label_0005
ORG 0x2000
DATA 0xFF
DATA 0x3F
DATA 0xFF
DATA 0x3F
END
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?