Page 1 of 1

DMX 512 8 byte receiver (Component)

Posted: Sun Mar 15, 2009 8:09 pm
by Jaspervdw
Hey,

I finally did it. I made a DMX receiver!
This project reads in the first 8 byte of the DMX code and puts it by PWM on Port D(0-7). It is made for the 16F877A.
The code is not yet optimal, but it works!
I'll try to make it better so that it can be easily used (and changed) in Flowcode.

Enjoy this code!

Re: DMX 512 (8 byte reading and pwm on port D)

Posted: Fri Mar 20, 2009 11:22 am
by Jaspervdw
Hey,

As promised is here a better version of the DMX512 receiver. I put it in the component (Custom component).
The component has two functions.
- SetAdress:
This function allow you to set the 8 bytes you want to read from the DMX channel. the value of this addresses must be between 1-512 (0x001 - 0x200).
- ReadByte:
This function allow you to read the DMX value at the previous specified address and put it in a byte.

Example:
SetAdress(0x01,0x02,0x13,0x14,0x15,0x16,0x17,0x18);
Readbyte(0); --> reads byte at address 0x01 --> (channel 1);
Readbyte(1): --> reads byte at address 0x02 --> (channel 2);
Readbyte(2); --> reads byte at address 0x13 --> (channel 19);

Enjoy it!

Jasper

Re: DMX 512 8 byte receiver (Component)

Posted: Fri Mar 20, 2009 1:24 pm
by Benj
Great thanks for the code Jasper.

If I get any requests for DMX examples I will forward them to your forum topic.

Re: DMX 512 8 byte receiver (Component)

Posted: Sat Apr 25, 2009 12:29 pm
by dizzy_dw
Jasper,

Do you know if your component also works on the ECIO28P (PIC18F2455)?

Are there any external components needed (except a RS-485 to RS-232 convertor which I've already connected)?

I'm trying to show the current value on a set DMX-channel on a LCD-dispay.
So far I'm only getting the value 240 (whatever I send to the channels).

I presumed SetAddress has to be called just once. Am I correct?

Thanks in advance.

Greets,
Desmond

B.t.w: Nice work! I only hope I can get it to work on my uC

Re: DMX 512 8 byte receiver (Component)

Posted: Sat Apr 25, 2009 2:34 pm
by Jaspervdw
Desmond,

The problem is probably that your Βµc is running at 4Mhz, the code is made for 20 Mhz.
I don't have enough knowledge (from flowcode) to make the code fit for any oscillation speed.
You can try to adjust the C-code of the component. I think you only have to adjust the baudrate:

Code: Select all

txsta.BRGH = 1;        // Set baudrate to high speed (p113)
spbrg      = 0x04;     // Set Baud Rate Generator Registor to 245760 i.s.o 250000 error 1,70%
SetAdress has to be called once.

Greetings,

Jasper

Re: DMX 512 8 byte receiver (Component)

Posted: Mon Apr 27, 2009 8:33 am
by Benj
Hello Dizzy, Jasper

For use of the program with the ECIO devices you must create the baud rate to match a 48MHz clock speed.

For a baud rate of 250000 with 0% error the C code should be:

txsta = 4; // Set baudrate to high speed
spbrg = 127; // Set Baud Rate Register

Re: DMX 512 8 byte receiver (Component)

Posted: Thu Jul 02, 2009 6:49 am
by Jaspervdw
Those this code work with other people?

Re: DMX 512 8 byte receiver (Component)

Posted: Wed Sep 09, 2009 11:24 am
by EPIC
Hi, has anyone got any simple example program as to how this component works? :?:

Re: DMX 512 8 byte receiver (Component)

Posted: Thu Dec 26, 2013 10:52 am
by boogui
hello

i put the files in the component folder of flowcode 5, rename them with "FC5_PIC_" in front , but when i try to use the component an error pop up.

as anyone ever succeed with this? is there a version for FC5 ?

best regards