Hi Folks, we have note made a DMX-512 receiver but as the topic is under discussion: I have included a parallel to DMX-512 converter code for PIC running at 4MHz which I wrote as a tool to test DMX-512 receivers (what I never have...) well maybe it is useful to someone antti ; Parallel to DMX-512 Converter ; Copyright (C) 1996 Silicon Studio. All rights reserved. ; ; Target PIC16C5X or PIC16CXX at 4MHz Clock ; ; Description of hardware: ; Port B 8 Bit Data Input ; RA0 DMX-512 Output ; RA1 Busy/Ready Output ; RA2 Strobe Input ; ; This device will set Ready and wait for Strobe ; and transmit 8 bit data at 250 kbaud! that all it does! ; It should be possible to use it connected ; to LPT as demo device for testing DMX-512 system? ; (We have not done it) ; comments as always to comment@sistudio.com :)_ ; Processor 16CXX ;Select correct type? __FUSES 0x3FF9 dmx_port = 5 ;Port A host_port = 5 data_port = 6 ;Port B tx_reg = 0x0f ;Transmit register #define busy_out host_port,1 ;Busy output #define strobe_in host_port,2 ;Strobe input #define w_ready movlw 0x03 ;TX out inactive, not Busy #define w_busy andlw 0xFD ;Set busy in W, tricky here... ; ; Start ; movlw 0x01 ; Not Ready, TX out inactive movwf host_port ; Set outputs movlw 0xFC ; PA0, PA1 are outputs tris host_port ; Set TRIS loop w_ready ;4 movwf host_port ;4 STOP is generated here wait_strobe btfss strobe_in ; Strobe? goto wait_strobe ; Wait for HOST Strobe ; ; 250 KBaud Async Serial Transmitter ; bcf dmx_port,0 ;4 ->Start movwf tx_reg ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->0 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->1 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->2 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->3 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->4 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->5 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->6 rrf tx_reg,F ;4 movf tx_reg,W ;4 w_busy ;4 movwf dmx_port ;4 ->7 goto loop ;8 END ; -- Silicon Studio Ltd. -- http://www.sistudio.com