Decoding DMX with picbasic pro


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Nov 2004
    Posts
    61


    Did you find this post helpful? Yes | No

    Default

    Hi -

    From what I can tell, you've copied the code I posted a few months ago verbatim. And I know that the code is good.

    What I posted was a *subroutine* which checks for DMX at a particular address.

    But, if what you've posted is in fact your entire project, it seems that you haven't added anything to it all!

    RCIF needs to be defined as whichever bit of the PIR register it actually is. Without it being defined, you code may return strange results. PIR1.5? Check your datasheet.

    The PULSIN routine in my code looks for DMX on PORTB.1, which is the RX pin for the processor I used. Your first post from a few days ago mentions that you're hoping to receive on PORTC.7. But you haven't changed the PULSIN command to suit, so there's no chance it will work right out of the box.

    You're using a different oscillator than I did. Have you confirmed that SPBRG and BRGH have the same values?

    How do you know you're even finding the break signal? Have you added any flags or pin-twiddles which let you know where the program is at any given time?

    One thing I did when I started writing the code was to insert something like this:

    If break signal was received
    high PORTB.FOO
    pauseus 10
    low PORTB.FOO
    endif

    Then, I could monitor the incoming signal and the FOO pin at the same time on my 'scope. Once I saw the FOO pin pulsing at exactly the proper position, I moved on to decoding other parts of the DMX stream. But if you don't catch the break signal properly, you don't have a chance at getting the rest of the stream.

    There are so many inconsistencies here that it's hard to know where to start...

    John

  2. #2
    Join Date
    Jan 2006
    Posts
    8


    Did you find this post helpful? Yes | No

    Smile pic 16f627 20mhz

    Thank you JEC for your very detailed answer.
    Indeed I am only at the beginning of my project.

    My objective is to be able to decode DMX stream with a 16F627 or a 18Fxxx (what explains the differences of port RX between my different "post"), to use it for different functions not yet definite.


    All that in PICBASIC if possible.
    By the way I use an 20 MHz oscillator.
    I wish to proceed by small steps

    1) first, detect signal DMX, and light a LED if it is present on RX pin.

    For example, if the break is detected.

    2) Then, store DMX value on a preset address, (in my example address 20).


    3) View this value in a way or another


    4) using this value to dim a LED, if possible on a pin of the processor use.


    Thank you for all your examples, but I am almost a beginner in programming, so I require also the good DEFINE of the variables used.

    I will continue my experiments with these new councils.

    So long.
    Fred

Similar Threads

  1. ICD, ICSP and Picbasic Pro
    By mwhatley in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 8th August 2024, 21:42
  2. How to configure SPI in PICBASIC PRO?
    By moogle in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 15th April 2007, 19:31
  3. Question for all that use MELABS PICBASIC PRO
    By oskuro in forum Off Topic
    Replies: 2
    Last Post: - 24th March 2005, 18:15
  4. DMX & PicBasic coding problem
    By magicmarty in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th September 2004, 16:35
  5. PicBasic Pro & PicBasic syntax different
    By Billyc in forum General
    Replies: 5
    Last Post: - 16th April 2004, 22:19

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