4 Chanel Dmx512 ready assembly code to PBP ?


Closed Thread
Results 1 to 11 of 11
  1. #1
    Join Date
    Mar 2007
    Posts
    16

    Default 4 Chanel Dmx512 ready assembly code to PBP ?

    Hi friends i have found a dmx512 receiver code for 16f628 in another web forum and made some changes on it.
    it is 4 chanel dimming code working on 20 MHZ osc. tryed it and working no problem on it
    but i want to make same code in PBP can you help me for this ? Assembly Code is here ............

    http://members.chello.nl/g.assies/DMX2.pdf

    ------------------------------------------------------------------------

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by syscoder View Post
    Hi friends i have found a dmx512 receiver code for 16f628 in another web forum and made some changes on it.
    it is 4 chanel dimming code working on 20 MHZ osc. tryed it and working no problem on it
    but i want to make same code in PBP can you help me for this ? Assembly Code is here ............

    http://members.chello.nl/g.assies/DMX2.pdf

    ------------------------------------------------------------------------
    Sure, I can help you.
    How much money do you want to spend on it?
    Or you can write some code yourself (again), and we can probably HELP you make it work, instead of make it work for you...
    Last edited by skimask; - 5th March 2007 at 23:19. Reason: duhhhh

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


    Did you find this post helpful? Yes | No

    Default

    Firstly, I class myself as a newbie when it comes to PBP... so can't help you out with your question.

    However, I think that you are asking a tool order if you want the guys here to convert assembly code to a working PBP program and then help you modify it and adapt it to suit your needs.

    Maybe you should / could contact the author of the assembly code and ask them if they could interpret what each line of ASM code does, and then have a go at writing the PBP code and then post that up and ask for assistance if / when it won't work.

  4. #4
    Join Date
    Mar 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default dmx

    it is ok thanks i have solved it and working now. no problem on it..

  5. #5
    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

  6. #6
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by syscoder View Post
    hi friends i search in the forum and found many examples thanks.
    You also appear to have MANY POSTS.

    Why post the same thing in three threads in the same forum ?????

    I didnt read the whole of your code but just this bit is flawed.

    level1 = RCREG
    So at this point you are reading a lighting level 00-FF (0-255) into a variable called "level1"

    portC.1 = level1 'i want to dimm led on port c.1
    Now you try to assign a byte size variable to a single BIT of an output port which can only ever be 0 or 1, OFF or ON.

    It has been stated several times that you need to create a PWM signal to DIM your LEDs. You need to read up on how to do that. Plenty of examples all over the forum and the wider Internet.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  7. #7
    Join Date
    Mar 2007
    Posts
    16


    Did you find this post helpful? Yes | No

    Default dmx

    i looked all of this forum and internet but couldnt find any example for that can you send where is it?
    ot if you can help maybe you can writte to me some code

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


    Did you find this post helpful? Yes | No

    Angry

    We, the forum, aren't in the habit of writing code for people. You might be able to pay someone to write the code for you.

    Please stop posting in multiple locations about this issue

  9. #9
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen View Post
    We, the forum, aren't in the habit of writing code for people. You might be able to pay someone to write the code for you.

    Please stop posting in multiple locations about this issue
    Yep, I'm done with this guy too...

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


    Did you find this post helpful? Yes | No

    Default

    Syscoder, would you care to run through your code you posted and comment on what it is supposed to do at each section... my guess is that you can't because its's something you have simply copied from someone else, otherwise you would of spotted the flaw Keith has pointed out.

    You see this forum isn't a place where you come and ask for someone to provide free of charge the code and schematic for your project. Its a forum where others help you resolve problems with your own code. The guys here are very helpful, but its a two way exchange and you have to put in the effort too, and show that you have an understanding of the basics of what you are trying to do, something which you obviously haven't as you would of understood that any dimming / fading of lights generally requires a PWM output from the PIC.

    Maybe if you stopped posting about the same subject in several threads, swatted up on the fundimentals of DMX control, write your own code, breadboard the hardware and then post back here with your code when you have issues, you might get a more welcome responce.

  11. #11
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by malc-c View Post
    Maybe if you stopped posting about the same subject in several threads, swatted up on the fundimentals of DMX control, write your own code, breadboard the hardware and then post back here with your code when you have issues, you might get a more welcome responce.
    Or maybe not!

Similar Threads

  1. decoding quadrature encoders
    By ice in forum mel PIC BASIC Pro
    Replies: 93
    Last Post: - 28th February 2017, 10:02
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 22:31
  3. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  4. Making PBP code more modular
    By forgie in forum General
    Replies: 30
    Last Post: - 25th October 2005, 17:24
  5. Replies: 2
    Last Post: - 8th August 2004, 17:00

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