DMX Interface


Closed Thread
Results 1 to 7 of 7

Thread: DMX Interface

  1. #1
    electronicsuk's Avatar
    electronicsuk Guest

    Default DMX Interface

    Hello all.
    I have been trying to make a DMX interface based on the timing diagram found at http://www.dmx512-online.com/packt.html

    Please could somebody point me in the right direction as to how to send DMX using PIC Basic Pro. I am using an RS485 line driver connected to the PIC.

    If somebody can give us some example code that would be brilliant.

    Thanks,
    Matt

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

  3. #3
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    I had already looked though that post and it mostly talks about recieve, there is no code that talks about sending from what i can see.

    Thanks,
    Matt

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Transmitting is going to be similar to receiving. Do you have a in depth knowledge of DMX? If so it should not be too hard to translate the receive code for transmitting.

  5. #5
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    I honestly can't see where I'm going wrong. Here's a rough outline of what I'm doing:

    Set SPBRG to 4, for 250Kbaud @ 20Mhz
    Enable asynchronous serial port in RCSTA register
    Enable transmit in TXSTA register

    Then when it comes to sending data, I start with the DMX break by forcing portb.2 on the 16F627 high for 120uS. Following this is a 12uS MAB during which portb.2 is low. I then transmit a zero value for the start code, and then a number of DMX bytes following that.

    I've had no success at all so far, I've tried altering the code so that the serial port is disabled during the time that I force it high/low and then enabling again to send data, I've tried removing the 12uS MAB pause completely, and I've also tried sending portb.2 low for the break and high for the MAB instead of the other way round, but the way I see it, this shouldn't be necessary anyway as the line driver will invert the output.

    The most frustrating thing is that I have done this before and had it working fine, but have since lost the code when I formatted my computer. I thought the 75176 rs-485 transceiver could be the culprit, but I've tested it as best I can and it appears to be fine. So in short, I'm stumped.

  6. #6
    Join Date
    Nov 2004
    Posts
    61


    Did you find this post helpful? Yes | No

    Default Dmx Xmit

    Methinks you're transmitting backwards.

    With the USART off, you need to hold the pin on your PIC high.

    You'll swing low for the break, then high for MAB.

    Then, if you turn on the USART the pin will be *forced* high, because that's how USARTs do things.

    So your startcode and data bytes will be active low as they're trasmitting.

    John

  7. #7
    electronicsuk's Avatar
    electronicsuk Guest


    Did you find this post helpful? Yes | No

    Default

    Hi John, thanks for the reply. I have tried both high break/low MAB and low break/high MAB with no success, but I will give it another shot when I next get some time to work on this circuit.

    Cheers,

    Matthew

Similar Threads

  1. Simple 4 channel DMX controller
    By eggman in forum Code Examples
    Replies: 19
    Last Post: - 18th July 2012, 01:40
  2. Replies: 33
    Last Post: - 19th March 2010, 03:02
  3. Dmx
    By electronicsuk in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th November 2008, 07:56
  4. 'SCI' interface
    By ecua64 in forum Off Topic
    Replies: 0
    Last Post: - 29th September 2005, 16:02
  5. DMX & PicBasic coding problem
    By magicmarty in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th September 2004, 15:35

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts