技术热线: 4007-888-234

Welcome to the DMX 512 Printerport Interface page

更新时间: 2019-03-23
阅读量:1810

Welcome to the DMX 512 Printerport Interface page



Asm file for pic16c84 or 16f84 running at 1MHz



 ;12 inputs for switches (resistor to ground, switch to +5v) ;dmx output on channels 1 to 12, off or full on (FFh) ; port A0 is DMX output, connect to sn75176 dmx driver (see dongle jpg) list p=16c84,f=inhx8m #include

ch1 equ 0x10 ch2 equ 0x11 ch3 equ 0x12 ch4 equ 0x13 ch5 equ 0x14 ch6 equ 0x15 ch7 equ 0x16 ch8 equ 0x17 ch9 equ 0x18 ch10 equ 0x19 ch11 equ 0x1A ch12 equ 0x1B org 0x00 goto start org 0x05 start bsf STATUS,RP0 movlw 0xFF ; port b input movwf TRISB movlw 0xFE ; portA0 output, other bits input movwf TRISA movlw b'11010000' movwf OPTION_REG movlw b'00100000' ; don't allow interrupt movwf INTCON bcf STATUS,RP0 begin movlw 0x00 movwf ch1 movwf ch2 movwf ch3 movwf ch4 movwf ch5 movwf ch6 movwf ch7 movwf ch8 movwf ch9 movwf ch10 movwf ch11 movwf ch12 movlw 0xff btfsc PORTB,0 movwf ch1 btfsc PORTB,1 movwf ch2 btfsc PORTB,2 movwf ch3 btfsc PORTB,3 movwf ch4 btfsc PORTB,4 movwf ch5 btfsc PORTB,5 movwf ch6 btfsc PORTB,6 movwf ch7 btfsc PORTB,7 movwf ch8 btfsc PORTA,1 movwf ch9 btfsc PORTA,2 movwf ch10 btfsc PORTA,3 movwf ch11 btfsc PORTA,4 movwf ch12 dmxout bsf PORTA,0 bsf PORTA,0 bcf PORTA,0 nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop bsf PORTA,0 bsf PORTA,0 bcf PORTA,0 ;startbit nop ;begin startcode nop nop nop nop nop nop nop bsf PORTA,0 ;stopbits bsf PORTA,0 bsf PORTA,0 movlw 0x10 movwf FSR chanel movf INDF,w bcf PORTA,0 movwf PORTA nop nop nop nop nop nop nop bsf PORTA,0 bsf PORTA,0 bsf PORTA,0 bcf STATUS,2 clrwdt incf FSR movf FSR,w xorlw 0x1C btfss STATUS,2 goto chanel goto begin end

2016062716593053606.jpg