me_guitarist
Full Member level 6
Can someone convert this code to suite into PIC12F675?
;Project: Siren Sound
List P = 16F84
#include <p16F84.inc>
__CONFIG 1Bh ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC
ORG 0 ;This is the start of memory for the program.
Setup BSF 03,5 ;Go to Bank 1
CLRF 06 ;Make all port B output
BCF 03,5 ;Go to Bank 0 - the program memory area.
CLRF 06 ;Clear display
GOTO Siren
Siren MOVLW 80h ;Number of cycles for each tone
MOVWF 0Eh
MOVWF 10h
MOVLW 50h ;Number of steps
MOVWF 0Fh ;File 0F holds the number of steps
MOVLW 50h ;Determines frequency
MOVWF 0Ch ;File 0C determines the frequency
Repaet MOVF 0C,0 ;File 0C is moved to W
MOVWF 0D ;W is moved to file 0D for decrementing
On BSF 06,7 ;Length of HIGH time to Piezo
DECFSZ 0D,1
GOTO On
MOVWF 0Dh ;W is moved to file 0D again
Off BCF 06,7 ;Length of LOW time to Piezo
DECFSZ 0D,1
GOTO Off
DECFSZ 10h,1 ;Number of cycles for each tone
GOTO Repeat
DECF 0C,1 ;HIGH and LOW is shortened -tone rises
INCF 0E,1 ;Increase the number of cycles
MOVF 0E,0 ;File 0E to W
MOVWF 10h ;W to file 10h
DECFSZ 0F,1 ;Number of steps
GOTO Repeat
GOTO Siren
END
;Project: Siren Sound
List P = 16F84
#include <p16F84.inc>
__CONFIG 1Bh ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC
ORG 0 ;This is the start of memory for the program.
Setup BSF 03,5 ;Go to Bank 1
CLRF 06 ;Make all port B output
BCF 03,5 ;Go to Bank 0 - the program memory area.
CLRF 06 ;Clear display
GOTO Siren
Siren MOVLW 80h ;Number of cycles for each tone
MOVWF 0Eh
MOVWF 10h
MOVLW 50h ;Number of steps
MOVWF 0Fh ;File 0F holds the number of steps
MOVLW 50h ;Determines frequency
MOVWF 0Ch ;File 0C determines the frequency
Repaet MOVF 0C,0 ;File 0C is moved to W
MOVWF 0D ;W is moved to file 0D for decrementing
On BSF 06,7 ;Length of HIGH time to Piezo
DECFSZ 0D,1
GOTO On
MOVWF 0Dh ;W is moved to file 0D again
Off BCF 06,7 ;Length of LOW time to Piezo
DECFSZ 0D,1
GOTO Off
DECFSZ 10h,1 ;Number of cycles for each tone
GOTO Repeat
DECF 0C,1 ;HIGH and LOW is shortened -tone rises
INCF 0E,1 ;Increase the number of cycles
MOVF 0E,0 ;File 0E to W
MOVWF 10h ;W to file 10h
DECFSZ 0F,1 ;Number of steps
GOTO Repeat
GOTO Siren
END