Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help on Circuit

Status
Not open for further replies.

kogula14

New Member
Hi. Currently i have to do a microp 8085 project. so i select to do a traffic controller circuit using 8085. Actually i try to start from basic so i found "THIS" diagram from website and upload it in attachment.My question is
- is it i have to add IC other than 8085 microp to make sure it function such as eeprom IC?
-what is the simple method that can be apply to edit the circuit that i upload?
- OR this circuit totally have to change if want use 8085 on it.

Thanks.
 

Attachments

  • traffic.gif
    traffic.gif
    4.3 KB · Views: 227
Kind of a strange circuit. You will always have the RED led lit if you light a GREEN or AMBER LED.

PS use a micro that can drive LEDs directly, like a PIC or ATMEL.
 
Kind of a strange circuit. You will always have the RED led lit if you light a GREEN or AMBER LED.
Yes.... Just like a real traffic light. When the East/West traffic light is yellow or Green, the North/South traffic light is red...etc.... :D
 
In Canada we have double red in both directions for a moment. I built a fun traffic light for a display. Uses muxed LEDs on GPIO 2, 4 & 5 (3 wire, 6 LEDs)

Ugly code (first draft) but it works. Even does advance on flashing green.
g=flashing green

Sequence Rg, RG, RA, RR, gR, GR, AR, RR (repeat)


Code:
 ;LEDs are connected to GPIO 2,4 & 5
         list     p=12C508
         include <P12C508.inc>
         __CONFIG _WDT_OFF &_IntRC_OSC
         cblock 0x007
         d1
         d2
         Count                      ;loop counter
         LCount                     ;longer counter
         endc
         org        0
         movlw    b'11001110'
         option
Start
; Green will flash for 1/2 the time (Advance Green for Turning)
         movlw    .6
         movwf    LCount
         clrf        Count             ;Reset Count
RlGr    call        Red1              ;Red left
         btfss      LCount, 2
         goto       NoFlash
         btfsc      Count, 6
         call        Green2            ;Green on
         btfss      Count, 6
         call        LEDoff            ;All LEDs off
         goto      Done1
NoFlash  call     Green2
Done1    decfsz   Count
          goto     RlGr              ;Wait
          decfsz   LCount
          goto     RlGr
         
          movlw    .150
          movwf    Count             ;Loop count
RlAr     call     Red1              ;Red left
          call     Amber2            ;Green right  
          decfsz   Count
          goto     $-3             ;Wait
         
          movlw    .150
          movwf    Count             ;Loop count
RR       call     Red1              ;Red left
          call     Red2            ;Green right  
          decfsz   Count
          goto     $-3              ;Wait
                 
          movlw    .6
          movwf    LCount
          clrf      Count             ;Reset Count
RrGl     call      Red2              ;Red left
          btfss    LCount, 2
          goto     N_Flash
          btfsc    Count, 6
          call      Green1            ;Green on
          btfss    Count, 6
          call       LEDoff            ;All LEDs off
          goto     Done2
N_Flash  call     Green1
Done2    decfsz   Count
         goto     RrGl              ;Wait
         decfsz   LCount
         goto     RrGl
         
         movlw    .150
         movwf    Count             ;Loop count
RrAl     call     Red2              ;Red right
         call     Amber1           ;Green left
         decfsz   Count
         goto     $-3
         
;Red Red
         movlw    .150
         movwf    Count             ;Loop count
         call     Red1              ;Red left
         call     Red2            ;Green right  
         decfsz   Count
         goto     $-3              ;Wait
         
         goto     Start

Red1    movlw    b'11011011'       ;RED left
          tris    GPIO
          movlw    b'00100000'
          movwf    GPIO
          goto    R80ms

Red2    movlw    b'11001111'       ;RED left
          tris    GPIO
          movlw    b'00100000'
          movwf    GPIO
          goto    R80ms

Amber1    movlw    b'11101011'       ;Amber left
         tris    GPIO
         movlw    b'00010000'
         movwf    GPIO
         goto    R80ms

Amber2    movlw    b'11101011'       ;Amber right
         tris    GPIO
         movlw    b'00000100'
         movwf    GPIO
         goto    R80ms

Green1    movlw    b'11011011'       ;Green left
         tris    GPIO
         movlw    b'00000100'
         movwf    GPIO
         goto    R80ms

Green2   movlw    b'11001111'       ;Green right
         tris    GPIO
         movlw    b'00010000'
         movwf    GPIO
         goto     R80ms

LEDoff   movlw    b'11111111'       ;No LEDs
         tris    GPIO
         nop                        ;Timing 
         nop
         goto     R80ms       

R80ms    movlw    0x57                ;refresh loop 2x40ms
            movwf    d1
            movlw    0x03
            movwf    d2
Delay_0
           decfsz    d1, f
           goto    $+2
           decfsz    d2, f
           goto    Delay_0
            retlw    0
           end
 
Last edited:
In Canada we have double red in both directions for a moment.
I've often wondered WHY we have that since most people are asleep at the light and do not wakeup until it's been green for 2-3 seconds anyway. ;)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top