DMX512 Problem ..Schema+Code


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    DMX baudrate is 250 000 Baud, 9600 will never ever work.

    AND as you dont use any HSERIN/HSEROUT, the DEFINE HSER_xxx are useless. You need to write the right value directly to the SPBRG, RCSTA, TXSTA register

    AND @4MHZ... good luck to have a reliable 250K baud serial comm. 12MHZ and up will work.
    Last edited by mister_e; - 25th February 2007 at 21:38.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Default still have problem

    thanks for helping. i have tryed it with 250.000 too but stll have some problem and not working do youahev any schematic like this or some code to help to me about this dmx512aderes systems?

  3. #3
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    Edited - just saw the original post - sorry

  4. #4
    Join Date
    Feb 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Dmx Problem

    is there anybody here to solve my problem ?
    for my schmatic i have 20mhz osc and 9dipsw+and 16f628A i want to dim 3 led output,
    how can i make it ?

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If you're using the right USART setting for the right OSC speed, having properly set the PIC config fuses, added DEFINE OSC 20, i think your code will work.

    google for PIC16F628 gave me
    http://si-light.sourceforge.net/
    http://www.qsl.net/n5tle/
    http://www.epanorama.net/links/lights.html#dmx512
    http://www.elektronicaforum.nl/dmx-bouwen-t644.html
    http://www.epanorama.net/digipack/DMX_Pro/index.html
    Last edited by mister_e; - 26th February 2007 at 23:24.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Feb 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Code Problem

    Thanks mister ;
    i saw that websites before and i know how to search "dmx" on the google yhanks for it.
    i need a code for my project i have that code but 6 people says that it doesnt wrong there is some problem in it but you say that it will work?
    did you understand tht what i need or what i want to say for my schema?

    can you look to my code and give right code because it is not working my code is for 20 osc and also im sure my fisues are ok.
    if you have another schema or code also you can give i can make it too for 512 or 256 adres no problem

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    what do you have on hand to say it's not working? which console OR software?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by programmer07 View Post
    Thanks mister ;
    i saw that websites before and i know how to search "dmx" on the google yhanks for it.
    i need a code for my project i have that code but 6 people says that it doesnt wrong there is some problem in it but you say that it will work?
    did you understand tht what i need or what i want to say for my schema?

    can you look to my code and give right code because it is not working my code is for 20 osc and also im sure my fisues are ok.
    if you have another schema or code also you can give i can make it too for 512 or 256 adres no problem
    Let's see your code and schematic. Also, which version of PBP are you using?

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I already said...
    Quote Originally Posted by mister_e View Post
    AND as you dont use any HSERIN/HSEROUT, the DEFINE HSER_xxx are useless. You need to write the right value directly to the SPBRG, RCSTA, TXSTA register
    so begin with...
    Code:
    RCSTA = $90 ' Enable serial port & continuous receive
    TXSTA = $24 ' Enable transmit, BRGH = 1
    SPBRG = 4   ' 250 KBaud @ 20MHz, 0.0%
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    Join Date
    Feb 2007
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Dmx Problem

    Dear Mister_e;
    yes many thereads in the forum but everybody has problem to receive dmx and nobody has succeed it..if you can writte and example here for us
    i know i have to use "hserin" command and it must be 250000baud it is not my problem i know them how to make..

    i want to see Code example to receive with "Hserin" Command.

    You said to me that i have to use "Hserin" Commmand For DMX receive But you didnt Writte it here ,

    How can i use it with 16f628A adn 20 mhz ;
    I didnt build my own master.(Transmitter) i use normaly device for lighting deskControl.and it works with dmx protocol .

    can you writte code here for how to receive it.
    i have standart dmx512 control device .. i need 512 receiver and it must be 3 chanel for my 3 leds you can look to my schematic

  11. #11
    Join Date
    Mar 2005
    Location
    CROATIA
    Posts
    38


    Did you find this post helpful? Yes | No

    Default tx yes but rx hardly

    if you create asm sub (you can see i.ex manolator source@4mhz) and call that sub every time when you want to make output, must be carefull, timings are critical read the dmx protocoll
    another thing is dmx protocol is 250kb but is 11bit information with speciall startbit which is not standard. so forged using anny hserin or hseout exept if you can do some kind of hardware bit cutter/splitter-manipulator

    sorry for my english, im not shure that i'm uderstundible

    if someone is interested and able to programm DMX mini desk (i think can be done i.ex with 18f452) my wish is to see (and help)make those code (and schematic)

  12. #12
    Join Date
    Mar 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default dmx

    hi friends i search in the forum and found many examples thanks. i have pic 16f876 , 20 mhz osc and 1 led ,i have dmx512 lighting desk too and i want to dimm a led on dmxadres 1 (0-255 to led intensty) but there is some problem on this code it is not working. i found this code in the forum and made it again for my pic but couldnt find the problem.can you look to my code and say what is my problem here?or you can send other example code to receive dmx ..

    ' PIC 16F876 - 20MHZ OSC

    DEFINE OSC 20 ' 20 MHZ OSC
    DEFINE HSER_TXSTA 24h ' Enable transmit
    DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
    DEFINE HSER_SPBRG 4 ' 250 000 Baud @ 20MHz, 0.0%
    DEFINE HSER_CLROERR 1 ' Clear overflow automatically

    ASM
    ERRORLEVEL -306, -302
    ENDASM

    ADCON0 = 0
    ADCON1 = 7

    counter var word
    idleflag var word
    dummy var word
    RCIF VAR BYTE
    startcode var word
    aminus var word
    adress var word
    x var word
    level1 var word
    adress = 1 ' My Start Adress


    checkdmx:
    counter = 1 ' Dummy variable
    pulsin portC.7,0,counter 'Here looking for the break signal
    if counter = 0 then
    idleflag = 1 'either no dmx , or break was too long to count
    'return
    endif
    if counter < 40 then checkdmx ' watching for "break"
    dummy = RCREG
    dummy = RCREG
    SPBRG = 0
    TXSTA.2 = 0
    TXSTA.4 = 0
    RCSTA.7 = 1
    RCSTA.6 = 0
    RCSTA.4 = 0
    RCSTA.4 = 1

    while RCIF = 0: wend
    startcode = RCREG 'firs byte after break
    if startcode <> 0 then checkdmx
    aminus = adress -1

    for x = 1 to aminus
    while RCIF = 0: wend
    dummy = RCREG
    next x

    level1 = RCREG
    portC.1 = level1 'i want to dimm led on port c.1
    RCSTA.7 = 0

    goto checkdmx
    return

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


    Did you find this post helpful? Yes | No

    Angry

    Stop posting in multiple threads!

  14. #14
    Join Date
    Mar 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default dmx

    dear dynamoben here is a forum and we have to post something to learn.

    i make my code change and send it back why is it problem for you here is a forum and we have to post something you may not help just looking for a people that wo will find my problem to receive data no more.

  15. #15
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen View Post
    Stop posting in multiple threads!
    How many other answers do we get to give before we completely give up?

Similar Threads

  1. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 9th December 2008, 00:40
  2. 16f887 44 pin demo board code problem?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 7th December 2008, 15:17
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  4. 4 Chanel Dmx512 ready assembly code to PBP ?
    By syscoder in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 22nd March 2007, 00:55
  5. Code problem
    By chai98a in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 20th May 2006, 05:43

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