garostoss
Newbie level 5
- Joined
- Aug 19, 2015
- Messages
- 9
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 80
if i get you right in my program i do not have to set values for the ccpr1l and ccp1con since im using push button switches and set the pic in pwm mode?
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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 ; program starting START CLRF PORTA MOVLW 0x07 MOVWF CMCON BSF STATUS,RP0 MOVLW 0xFF MOVWF TRISA MOVLW B'00000011' MOVWF TRISB BCF STATUS,RP0 ; SWITCHES TESTING SW0 btfss portB,RB0 GOTO INCREASE GOTO SW1 SW1 BTFSS PORTB,RB1 GOTO DECREASE GOTO SW0 INCREASE BTFSS PORTB,RA1 GOTO SW0 INCF 32H,1 CALL PWM GOTO SW0 DECREASE DECF 32H,1 CALL PWM GOTO SW0 ; DISPLAY PWM MOVLW d'16' MOVWF TMR2 MOVLW B'00000111' MOVWF T2CON BSF STATUS,RP0 MOVLW B'01111100' MOVWF PR2 BCF STATUS,RP0 MOVLW B'00001100' MOVWF CCP1CON TESTS0 BTFSS PORTB,RB0 INCF CCPR1L BTFSS PORTB,RB1 DECF CCPR1L DISPLAY CALL BCD GOTO SHIFT BCD CLRF 33H TEN MOVLW D'10' SUBWF 32H,0 BTFSS STATUS,C GOTO SORT INCF 33H,1 MOVWF 32H GOTO TEN SORT SWAPF 33H,0 IOR 32H,0 RETURN ; SHIFT REGISTER SHIFT MOVLW D'8' MOVWF 34H BIT_DATA BTFSC 32H,7 BSF PORTB,5 BTFSS 32H,7 BCF PORTB,5 CLOCK BSF PORTB,6 BCF PORTB,6 RLF 32H,1 DECFSZ 34H,1 GOTO BIT_DATA GOTO SW0
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?