Dmx Solved !!!!!!!


Results 1 to 19 of 19

Threaded View

  1. #12
    Join Date
    Jun 2005
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Dragons Ahoy!

    Hi John--

    Well, I bought the DMX spec... the current version is now $40. I feel that I understand what's going on there well enough to proceed with trying to translate that into PICBasic.

    Problem is, the PICBasic documentation on HSERIN just isn't very complete, and my brain hurts after about 15 minutes of trying to understand the Microchip datasheet... it looks like in PICBasic you enable the receiver by using defines, which don't allow me to turn the port on and off at runtime unless I know what specific register bit I want to change. It looks to me like I turn it on and off by toggling the SPEN bit (RCSTA.7) of the RCSTA register? I don't understand how to clear the RCREG, like you say to do twice... are you saying in your previous post that I don't need to do anything with the CREN bit?

    Using PULSIN I did successfully detect the start break, which I then used to generate a PULSOUT on another pin that I put back into my 'scope to use as a trigger. I can see the data as it should look (compared to the USITT data sheet), so at least that part is working. The code I used is:

    loop:
    pulsin porta.7,0,count0
    if count0 >40 then exit '(look for pulse longer than 80uS)
    goto loop

    exit:
    pulsout portb.0, 200
    goto loop

    Is this similar to what's working for you? (minus the pulsout, of course...)

    Also, it occurs to me that according to the spec, if I take more than 4-8 microsecs to determine the pulse length and turn on the USART, I'll miss the header byte... have you been able to implement your DMX receiver using only PICBasic, or do you have some assembly in there too? Do you set the USART to automatically clear its errors or toggle the RCSTA.4 bit?

    I'm still feeling kind of fried by all this register settings stuff, but I'm happy I can at least detect the break! (Hey, it's a start...)

    Thanks again for your help---

    ---Alan
    Last edited by alanmcf; - 29th June 2005 at 10:02.

Similar Threads

  1. DMX receive issue
    By NoahLD in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 27th August 2014, 13:51
  2. Simple 4 channel DMX controller
    By eggman in forum Code Examples
    Replies: 19
    Last Post: - 18th July 2012, 01:40
  3. Dmx
    By electronicsuk in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th November 2008, 07:56
  4. Big Problem in PBP To receive DMX
    By programmer07 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th March 2007, 18:49
  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 : 0

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