Dmx Solved !!!!!!!


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    61


    Did you find this post helpful? Yes | No

    Default Dmx

    Two thoughts...

    First, I made a typo when I posted the original code:

    RCREG = dummy is bad. It should be
    dummy = RCREG to clear out the buffer.

    As far as catching the early data goes, it's probably more elegant to do something like

    while x < aminus
    'wait for a byte
    'discard it
    'increment x
    WEND

    This way, if aminus = 0 and your address = 1, the trashing routine is skipped altogether.

    ...

    And you're exactly right - there's no reason why you should need to use HSERIN at all to grab the last byte. I was experimenting back and forth reading the registers and using HSERIN. Once I got it stable, I didn't change everything to match.

    So you can leave it, or change it to say

    newlevel1 = RCREG

    Either way, it should work fine.

    Curious - what are you building?

    John

  2. #2
    Join Date
    Jun 2005
    Posts
    20


    Did you find this post helpful? Yes | No

    Default DMX Continued

    Hi John--

    I tried the While:wend loop you recommended to compensate for the adrress offset, but it didn't fix it... what DID fix it was getting rid of the HSERIN command-- when I changed that to newlevel1 = rcreg, it zeroed in on the correct address! I'm wondering if the HSERIN statement has some overhead that causes it to miss that first target byte?

    Regarding what I'm building, I replied to you offlist, so look for a message there.

    Thanks again--

    --Alan

    PS: Are there any gotchas if I want to use the USART to transmit DMX?

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