Did you have GND on anything?
if both the GND and 5V RAIL had 5V then there wasnt a ground hopefully. Without a ground nothing bad should happen i guess.
PIC's usually survive been put in the wrong way round, they are VERY sturdy devices, I've never managed to kill one yet.
Personally I never use breadboards, they are far too unreliable, and many problems posted here are down to breadboards, in particular connecting them incorrectly.
you should be fine. What are you using for a programmer?
I'm using a JDM enhanced with PICPgm software. I pulled it out, it redetected it and I was able to reprogram it as well.
Still isn't working though. I was wondering - I have the Config stuff set in my code. Do I have to set it in the software programmer too?
list p=pic16f737
#include <P16F737.inc> ; processor specific variable definitions
radix hex
;
__CONFIG _CONFIG1, _CP_OFF & _CCP2_RB3 & _DEBUG_OFF & _VBOR_2_0 & _BOREN_0 & _MCLR_OFF & _PWRTE_ON & _WDT_OFF & _INTRC_IO
__CONFIG _CONFIG2, _BORSEN_0 & _IESO_OFF & _FCMEN_OFF
;------------------------------------------------------------
; Counter locations
dbcount equ 0x21
dc1 equ 0x22
;------------------------------------------------------------
org 0x000
;
;Initialization
start bsf STATUS,RP0
bcf STATUS,RP1 ;bank 1
bsf OSCCON,IRCF2 ;set int osc 110=4Mhz
bsf OSCCON,IRCF1
bcf OSCCON,IRCF0
movlw 0x0f ;conifgure all pins as
movwf ADCON1 ; digital inputs
bcf OPTION_REG,7 ;enable PORTB pullups
movlw 0xf8 ;load w with 11111000
movwf TRISA ;make RA0-RA4 inputs,RA5-RA7 outputs
movlw 0xff ;load w with 1's
movwf TRISB ;make PORTB inputs
movlw 0xF ;load w with 00001111
movwf TRISC ;make RC0-RC3 outputs, RC4-RC7 inputs
bcf STATUS, RP0 ;bank 0
bsf PORTA,6 ;output hi RA6 - mute on
nop
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
movlw 0x00 ;load w with 0's
movwf PORTC ;all effects bypassed
bcf PORTA,6 ;output lo RA6 - mute off
;Main Program
switch btfss PORTE,3 ;bypass switch hi?
goto bypass ;no - swtich pressed
btfss PORTA,0 ;comp vb switch hi?
goto compvb ;no - switch pressed
btfss PORTA,1 ;comp switch hi?
goto comp ;no - switch pressed
btfss PORTA,2 ;flanger switch hi?
goto flanger ;no - switch pressed
btfss PORTA,3 ;chorus switch hi?
goto chorus ;no - switch pressed
btfss PORTA,4 ;delay switch hi?
goto delay ;no - switch pressed
btfss PORTB,0 ;comp delay switch hi?
goto compdelay ;no - switch pressed
btfss PORTB,1 ;comp flanger switch hi?
goto compflanger ;no - switch pressed
btfss PORTB,2 ;ch delay switch hi?
goto chdelay ;no - switch pressed
btfss PORTB,3 ;clch delay switch hi?
goto clchdelay ;no - switch pressed
btfss PORTB,4 ;cl flanger switch hi?
goto clflanger ;no - switch pressed
btfss PORTB,5 ;cl chorus switch hi?
goto clchorus ;no - switch pressed
btfss PORTB,6 ;clean switch hi?
goto clean ;no - switch pressed
btfss PORTB,7 ;comp delay vb switch hi?
goto compdlyvb ;no - switch pressed
goto switch ;check all switches again
; Switch Actions
;
bypass ; debounce switch down
db_down movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly
btfsc PORTE,3 ;if button up (RE3 hi),
goto db_down ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly
; actual switching
bsf PORTA,6 ;turn mute on
nop
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
movlw 0x00 ;load w with 0's
movwf PORTC ;all effects bypassed
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly incfsz dc1,f ;delay 256x3 = 768us
goto up_dly
btfss PORTE,3 ;if button down (RE3 lo),
goto db_up ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly
goto switch
compvb ; debounce switch down
db_down1 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly1 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly1
btfsc PORTA,0 ;if button up (RA0 hi),
goto db_down1 ;restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly1
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'10000000'
movwf PORTC ;turn comp on
bcf PORTA,5 ;output lo RA5 - vb on
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up1 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly1 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly1
btfss PORTA,0 ;if button down (RA0 = lo),
goto db_up1 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly1
goto switch ;check switches again
comp ; debounce switch down
db_down2 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly2 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly2
btfsc PORTA,1 ;if button up (RA1 hi),
goto db_down2 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly2
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'10000000'
movwf PORTC ;turn comp on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up2 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly2 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly2
btfss PORTA,1 ;if button down (RA1 lo),
goto db_up2 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly2
goto switch ;check switches again
flanger ; debounce switch down
db_down3 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly3 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly3
btfsc PORTA,2 ;if button up (RA2 hi),
goto db_down3 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly3
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'01000000'
movwf PORTC ;turn flanger on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up3 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly3 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly3
btfss PORTA,2 ;if button down (RA2 = lo),
goto db_up3 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly3
goto switch ;check switches again
chorus ; debounce switch down
db_down4 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly4 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly4
btfsc PORTA,3 ;if button up (RA3 hi),
goto db_down4 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly4
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'00100000'
movwf PORTC ;turn chorus on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up4 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly4 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly4
btfss PORTA,3 ;if button down (RA3 lo),
goto db_up4 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly4
goto switch ;check switches again
delay ; debounce switch down
db_down5 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly5 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly5
btfsc PORTA,4 ;if button up (RA4 hi),
goto db_down5 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly5
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'00010000'
movwf PORTC ;turn delay on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up5 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly5 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly5
btfss PORTA,4 ;if button down (RA4 lo),
goto db_up5 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly5
goto switch ;check switches again
compdelay ; debounce switch down
db_down6 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly6 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly6
btfsc PORTB,0 ;if button up (RB0 hi),
goto db_down6 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly6
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'10010000'
movwf PORTC ;turn comp and delay on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up6 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly6 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly6
btfss PORTB,0 ;if button down (RB0 lo),
goto db_up6 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly6
goto switch ;check switches again
compflanger ; debounce switch down
db_down7 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly7 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly7
btfsc PORTB,1 ;if button up (RB1 hi),
goto db_down7 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly7
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'11000000'
movwf PORTC ;turn comp and flanger on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up7 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly7 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly7
btfss PORTB,1 ;if button down (RB1 lo),
goto db_up7 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly7
goto switch ;check switches again
chdelay ; debounce switch down
db_down8 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly8 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly8
btfsc PORTB,2 ;if button up (RB2 hi),
goto db_down8 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly8
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'00110000'
movwf PORTC ;turn chorus and delay on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up8 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly8 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly8
btfss PORTB,2 ;if button down (RB2 lo),
goto db_up8 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly8
goto switch ;check switches again
clchdelay ; debounce switch down
db_down9 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly9 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly9
btfsc PORTB,3 ;if button up (RB3 hi),
goto db_down9 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly9
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'00110000'
movwf PORTC ;turn chorus and delay on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bcf PORTA,7 ;output lo RA7 - clean channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up9 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly9 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly9
btfss PORTB,3 ;if button down (RB3 lo),
goto db_up9 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly9
goto switch ;check switches again
clflanger ; debounce switch down
db_down10 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly10 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly10
btfsc PORTB,4 ;if button up (RB4 hi),
goto db_down10 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly10
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'01000000'
movwf PORTC ;turn flanger on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bcf PORTA,7 ;output lo RA7 - clean channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up10 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly10 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly10
btfss PORTB,4 ;if button down (RB4 lo),
goto db_up10 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly10
goto switch ;check switches again
clchorus ; debounce switch down
db_down11 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly11 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly11
btfsc PORTB,5 ;if button up (RB5 hi),
goto db_down11 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly11
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'00100000'
movwf PORTC ;turn chorus on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bcf PORTA,7 ;output lo RA7 - clean channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up11 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly11 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly11
btfss PORTB,5 ;if button down (RB5 lo),
goto db_up11 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly11
goto switch ;check switches again
clean ; debounce switch down
db_down12 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly12 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly12
btfsc PORTB,6 ;if button up (RB6 hi),
goto db_down12 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly12
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'00000000'
movwf PORTC ;turn chorus and delay on
bsf PORTA,5 ;output hi RA5 - vb off
nop
bcf PORTA,7 ;output lo RA7 - clean channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up12 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly12 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly12
btfss PORTB,6 ;if button down (RB6 lo),
goto db_up12 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly12
goto switch ;check switches again
compdlyvb ; debounce switch down
db_down13 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
dn_dly13 incfsz dc1,f ;delay 256x3 = 768us
goto dn_dly13
btfsc PORTB,7 ;if button up (RB7 hi),
goto db_down13 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto dn_dly13
; actual switching
bsf PORTA,6 ;turn mute on
movlw b'10010000'
movwf PORTC ;turn comp and delay on
bcf PORTA,5 ;output lo RA5 - vb on
nop
bsf PORTA,7 ;output hi RA7 - lead channel on
call mutedelay ;mute for 2ms
bcf PORTA,6 ;turn mute off
; debounce switch up
db_up13 movlw 0x0d ;max count = 10ms/768us = 13 = 0x0d
movwf dbcount
clrf dc1 ;reset dc1
up_dly13 incfsz dc1,f ;delay 256x3 = 768us
goto up_dly13
btfss PORTB,7 ;if button down (RB7 lo),
goto db_up13 ; restart count
decfsz dbcount,f ;else repeat until max count is reached
goto up_dly13
goto switch ;check switches again
;-----------------------------------------------------------------------------
; mutedelay - 2ms delay
;
mutedelay
;1993 cycles
movlw 0x8E
movwf dbcount
movlw 0x02
movwf dc1
Delay_0
decfsz dbcount, f
goto $+2
decfsz dc1, f
goto Delay_0
;3 cycles
goto $+1
nop ;4 cycles (including call)
return
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?