Signal and lights controlling unit

From uCtrl.net

(Redirected from SLCU)
Jump to: navigation, search
Symbols-Delete-256x256.png
Rack fullsize plan.png
The Rack box project is being discontinued!
I am moving to a new location, and therefor terminating the Rack box project, my plan is to build an even bigger system based on slot-in cards in a full size rack. I'll keep you posted. Feel tree to leave a comment if you have any question.
LTCU installed in the Rack box

SLCU, driven by AVR ATTiny2313.

Contents

Information

This is the Rack box alarm handling unit. It controls the stack light, strobes and horn. Six different signals can be displayed, according to alarm situation. If mute is active no signals is given. The power transistors for the stack light used to be located inside the module, hence the heat-sink. They have been moved to a separate power transistor unit.

Signals

Nr Situation Green Yellow Red Yellow strobe Red strobe Horn Horn w/muted
1 Flashing 100ms
2 Rack temp Steady Flashing Yes 1000ms
3 SIOS alarm Flashing Yes 1000ms
4 Serial offline Flashing Steady Yes 1000ms 100ms
5 Module offline Steady Flashing Yes 1000ms 100ms
6 Supply error Flashing Yes 1000ms 100ms

I/O

Inputs

  1. Signal 1
  2. Signal 2
  3. Signal 3
  4. Signal 4
  5. Signal 5
  6. Signal 6
  7. Mute

Outputs

  1. Stack light green
  2. Stack light yellow
  3. Stack light red
  4. Strobe yellow
  5. Strobe red
  6. Horn
  7. Lifesignal (to MSMU2)
  8. Lifelight

D-Sub 25-pin

  1. +5V
  2. 0V
  3. Strobe yellow
  4. Strobe red
  5. Horn
  6. Lifesignal
  7. Signal 1
  8. Signal 2
  9. Signal 3
  10. Signal 4
  11. Signal 5
  12. Signal 6
  13. Mute signal
  14. Stack light green
  15. Stack light yellow
  16. Stack light red

Images

Schematic drawing

Slcu circuit.png

Source code

The program is written in basic, using Bascom-AVR.

'--------------------------------------------------------------
'                         Thomas Jensen
'--------------------------------------------------------------
'  file: AVR_LTCU_2.0
'  date: 21/04/2009
'--------------------------------------------------------------
$crystal = 8000000
Config Portd = Input
Config Portb = Output
Config Watchdog = 1024
 
Dim Lifesignal As Byte
Dim Inn0 As Byte , Inn1 As Byte , Inn2 As Byte , Inn3 As Byte
Dim Inn4 As Byte , Inn5 As Byte , Inn6 As Byte , A As Byte
Dim Buffer1 As Byte , Buffer2 As Byte , Buffer3 As Byte
Dim Buffer4 As Byte , Buffer5 As Byte , Buffer0 As Byte
Dim S_timer As Byte , R_strobe As Byte , Y_strobe As Byte
Dim E_buff1 As Bit , E_buff2 As Bit , E_buff3 As Bit
 
'boot
Portb = 0
Portb.1 = 1
For A = 1 To 20
    Portb.0 = Not Portb.0
    Waitms 500
Next A
Portb.1 = 0
Portb.0 = 1
 
Waitms 2500
Start Watchdog
Portb = 0
 
Main:
'0 green flashing
If Inn0 = 8 Then Portb.0 = 1                                'green on
If Inn0 = 4 Then Portb.0 = 0                                'green off
 
'1 green stable, yellow flashing
If Inn1 = 8 Then
   Portb.1 = 1                                              'yellow on
   Y_strobe = 10
   End If
If Inn1 = 4 Then Portb.1 = 0                                'yellow off
 
'2 yellow flashing
If Inn2 = 8 Then
   Portb.1 = 1                                              'yellow on
   Y_strobe = 10
   End If
If Inn2 = 4 Then Portb.1 = 0                                'yellow off
 
'3 red stable, yellow flashing
If Inn3 = 8 Then
   Portb.1 = 1                                              'yellow on
   Y_strobe = 10
   End If
If Inn3 = 4 Then Portb.1 = 0                                'yellow off
 
'4 yellow stable, red flashing
If Inn4 = 8 Then
   Portb.2 = 1                                              'red on
   R_strobe = 10
   End If
If Inn4 = 4 Then Portb.2 = 0                                'red off
 
'5 red flashing
If Inn5 = 8 Then
   Portb.2 = 1                                              'red on
   R_strobe = 10
   End If
If Inn5 = 4 Then Portb.2 = 0                                'red off
 
'stable light off
If Inn1 = 0 And E_buff1 = 1 Then
   Portb.0 = 0
   E_buff1 = 0
   End If
If Inn3 = 0 And E_buff2 = 1 Then
   Portb.2 = 0
   E_buff2 = 0
   End If
If Inn4 = 0 And E_buff3 = 1 Then
   Portb.1 = 0
   E_buff3 = 0
   End If
 
'count down buffers and timers
If Buffer0 > 0 Then Buffer0 = Buffer0 - 1
If Buffer1 > 0 Then Buffer1 = Buffer1 - 1
If Buffer2 > 0 Then Buffer2 = Buffer2 - 1
If Buffer3 > 0 Then Buffer3 = Buffer3 - 1
If Buffer4 > 0 Then Buffer4 = Buffer4 - 1
If Buffer5 > 0 Then Buffer5 = Buffer5 - 1
If Inn0 > 0 Then Inn0 = Inn0 - 1
If Inn1 > 0 Then
   Inn1 = Inn1 - 1
   E_buff1 = 1
   Portb.0 = 1
   End If
If Inn2 > 0 Then Inn2 = Inn2 - 1
If Inn3 > 0 Then
   Inn3 = Inn3 - 1
   E_buff2 = 1
   Portb.2 = 1
   End If
If Inn4 > 0 Then
   Inn4 = Inn4 - 1
   E_buff3 = 1
   Portb.1 = 1
   End If
If Inn5 > 0 Then Inn5 = Inn5 - 1
If Inn6 > 0 Then Inn6 = Inn6 - 1
 
'set buffers
If Pind.0 = 0 Then
   If Buffer0 = 0 And Pind.6 = 1 Then S_timer = 1
   Buffer0 = 30
   End If
If Pind.1 = 0 Then
   If Buffer1 = 0 And Pind.6 = 1 Then S_timer = 10
   Buffer1 = 30
   End If
If Pind.2 = 0 Then
   If Buffer2 = 0 And Pind.6 = 1 Then S_timer = 10
   Buffer2 = 30
   End If
If Pind.3 = 0 Then
   If Buffer3 = 0 Then S_timer = 10
   Buffer3 = 30
   End If
If Pind.4 = 0 Then
   If Buffer4 = 0 Then S_timer = 10
   Buffer4 = 30
   End If
If Pind.5 = 0 Then
   If Buffer5 = 0 Then S_timer = 10
   Buffer5 = 30
   End If
 
'set timers
If Buffer0 > 0 And Inn6 = 0 And Inn0 = 0 And Buffer5 = 0 And Buffer4 = 0 And Buffer3 = 0 And Buffer2 = 0 And Buffer1 = 0 Then Inn0 = 8
If Buffer1 > 0 And Inn6 = 0 And Inn1 = 0 And Buffer5 = 0 And Buffer4 = 0 And Buffer3 = 0 And Buffer2 = 0 Then Inn1 = 8
If Buffer2 > 0 And Inn2 = 0 And Buffer5 = 0 And Buffer4 = 0 And Buffer3 = 0 Then Inn2 = 8
If Buffer3 > 0 And Inn3 = 0 And Buffer5 = 0 And Buffer4 = 0 Then Inn3 = 8
If Buffer4 > 0 And Inn4 = 0 And Buffer5 = 0 Then Inn4 = 8
If Buffer5 > 0 And Inn5 = 0 Then Inn5 = 8
 
'siren
If S_timer = 0 Then Portb.5 = 0
If S_timer = 10 And Pind.6 = 0 Then S_timer = 1
If S_timer > 0 Then
   S_timer = S_timer - 1
   Portb.5 = 1
   End If
 
'yellow strobe
If Y_strobe = 0 Then Portb.3 = 0
If Y_strobe > 0 Then
   Y_strobe = Y_strobe - 1
   Portb.3 = 1
   End If
 
'red strobe
If R_strobe = 0 Then Portb.4 = 0
If R_strobe > 0 Then
   R_strobe = R_strobe - 1
   Portb.4 = 1
   End If
 
'lifesignal
If Lifesignal > 0 Then Lifesignal = Lifesignal - 1
If Lifesignal = 6 Then
   Portb.6 = 1
   Portb.7 = 1
   End If
If Lifesignal = 1 Then
   Portb.6 = 0
   Portb.7 = 0
   End If
If Lifesignal = 0 Then Lifesignal = 21
 
'loop cycle
Reset Watchdog
Waitms 100
Goto Main
End
Personal tools
Namespaces
Variants
Actions
Navigation
Categories
projects
Toolbox