I use Picaxe chips to build control circuits for the audio preamps, volume controls, etc, that I design.
For some time now I have successfully been using a 14M2 chip to drive 5V telecom latching relays to switch line-level inputs and outputs. The coil resistance is 250 ohms and the 'must switch' voltage is around 3.7 volts. I parallel two pins to double the current (though I don't use load balancing resistors) so theoretically I get 50mA capability to deliver 20mA. When switching relays between high and low states I always set both pins first to 'input' and then both to high or low depending on need.
The relay specs say it switches in 4ms, and I use a 120uF capacitor and tried 220uF between the relay and ground to provide the drive when I want to reverse the relay. With a 14M2, this works very well using combinations of C.4 & B.1, and C.0 & B.5, but I can't get this method to work with an 08M2 using C.4 & C.1. I have tried a number of different routines with no luck -- the terminal shows the 08M2 is switching high/low as I command as does voltage output from the chip on the drive pins but the relay does not move. I have tried two different relays (same type) and two 08M2 chips without success.
I am down to the idea that the 08M2 cannot deliver the power needed to move the relay, I can't think of anything else. Wonder if anyone has an opinion.
For some time now I have successfully been using a 14M2 chip to drive 5V telecom latching relays to switch line-level inputs and outputs. The coil resistance is 250 ohms and the 'must switch' voltage is around 3.7 volts. I parallel two pins to double the current (though I don't use load balancing resistors) so theoretically I get 50mA capability to deliver 20mA. When switching relays between high and low states I always set both pins first to 'input' and then both to high or low depending on need.
The relay specs say it switches in 4ms, and I use a 120uF capacitor and tried 220uF between the relay and ground to provide the drive when I want to reverse the relay. With a 14M2, this works very well using combinations of C.4 & B.1, and C.0 & B.5, but I can't get this method to work with an 08M2 using C.4 & C.1. I have tried a number of different routines with no luck -- the terminal shows the 08M2 is switching high/low as I command as does voltage output from the chip on the drive pins but the relay does not move. I have tried two different relays (same type) and two 08M2 chips without success.
I am down to the idea that the 08M2 cannot deliver the power needed to move the relay, I can't think of anything else. Wonder if anyone has an opinion.
Code:
;Delay and Mute 12 PCB
; When relay is ON the audio is NOT muted.
; Change SYMBOL "Delay_Value" to set startup delay time in milliseconds
;Picaxe 08M2 Pinout
;Pin1 = +V
;Pin2 = C.5 (In, Serial In)
;Pin3 = C.4 (Touch/ADC/Out/In)
;Pin4 = C.3 (In)
;Pin5 = C.2 (In/Out/ADC/pwm/tune/SRQ/hi2c sda)
;Pin6 = C.1 (In/Out/ADC/hserin/SRI/hi2c scl)
;Pin7 = C.0 /Serial Out/Out//hserout/DAC)
;Pin8 = 0V
#Picaxe 08M2
#No_Data
SETFREQ m4
'Make all I/O pins inputs initially
Input C.4
Input C.2
Input C.1
'****************************************************************
'Set startup delay period here
SYMBOL PAUSE_Duration = 3500 'time in milliseconds 1/1000 second
'****************************************************************
;Pin assignments
;Control Inputs
SYMBOL Power_Good = pinC.3 '1=good 0=low
SYMBOL Mute_Switch = pinC.2 '0=muted 1=unmuted
;Audio Output (Relay1) Control
SYMBOL Rel_CtrlA = C.4
SYMBOL Rel_CtrlB = C.1
;variables storage
SYMBOL Power_State = b0 '24V Power 1=good 0=off
SYMBOL Muted = b1 'Muted Switch 0=muted 1=unmuted
'Delay for turn-on thumps and bumps to subside then enable output
PAUSE PAUSE_Duration '(NOTE - set duration above)
;Initialize relay position
'Cycle Output relay and start unmuted
GOSUB Rel_Ctrl_ON
PAUSE 50
GOSUB Rel_Ctrl_OFF
PAUSE 50
GOSUB Rel_Ctrl_ON
'Start main program loop to control input select and monitor power.
Main:
'check to see if power has been removed; if yes, shut down preamp
Power_State = Power_Good
IF Power_State = 0 THEN 'power is OFF
GOTO POWERFAIL 'restart the program including initial delay
ENDIF
'check position of "Mute" switch
Muted = Mute_Switch
IF Muted = 0 THEN
GOSUB Mute_Audio
ENDIF
'Troubleshooting send data to terminal only if needed
'SERTXD ("Power & Mute Status ",#b0," ",#b1,13,10)
'Loop
GOTO Main
'Restart control chip if power fails
POWERFAIL:
'Troubleshooting send data to terminal only if needed
'SERTXD ("Power Failed!!! ",13,10)
GOSUB Rel_Ctrl_OFF 'immediately mute the output
PAUSE 3000 'avoid dealing with rapid power changes if present
RESET 'Restart the program
'Mute switch ON routine
MUTE_AUDIO:
GOSUB Rel_Ctrl_OFF
DO WHILE Muted = 0
Muted = Mute_Switch
'Troubleshooting send data to terminal only if needed
'SERTXD ("Audio Muted ",#b0," ",#b1,13,10)
LOOP
GOSUB Rel_Ctrl_ON:
RETURN
'Relay switching subroutines
'Always make both pins "input" before changing their output state to avoid conflicting states
Rel_Ctrl_OFF:
Input Rel_CtrlA
Input Rel_CtrlB
PAUSE 10
Low Rel_CtrlA
Low Rel_CtrlB
RETURN
Rel_Ctrl_ON:
Input Rel_CtrlA
Input Rel_CtrlB
PAUSE 10
High Rel_CtrlA
High Rel_CtrlB
RETURN
Attachments
-
192.9 KB Views: 19
-
912.6 KB Views: 21
-
136.9 KB Views: 23