View previous topic :: View next topic |
Author |
Message |
mewanchyna
Joined: 21 Nov 2005 Posts: 15 Location: Montreal, Canada
|
dmx.c file |
Posted: Sat Oct 15, 2016 9:56 am |
|
|
I know we have covered this topic. There has been a lot of discussion on this and unfortunately, there is no correct answer. I have tried the file that is supplied in the "drivers" folder, dmx.c. Other than being a software UART, it seems to have no provisions for being a DMX receiver. I thought there might be a switching of the "xmit" pin for bi directional use but it is not clear. Besides, I think that pin reacts as an output. Do I need to deal with interrupts myself or is this handled by the dmx.c file?
I am looking to make a simple DMX to single PWM. The PWM is working as expected but I cannot get a single byte of DMX. Has anyone got the DMX.c and DMX.h files working or are they buggy?? Thanks,
Mark
PS I am using CCS 5.11 and PIC16F887 |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Sat Oct 15, 2016 12:41 pm |
|
|
rcving DMX is rather simple...just use Google to find any of 3 or 4 dozen programs that do that.
The CCS dmx.c is a transmitter from what I recall.
Jay |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19498
|
|
Posted: Sat Oct 15, 2016 12:44 pm |
|
|
For the receiver, the UART is setup in ex_dmx_slave.c, which then loads the driver. Look at this.
The software UART is used by the transmit only. |
|
|
mewanchyna
Joined: 21 Nov 2005 Posts: 15 Location: Montreal, Canada
|
|
Posted: Sat Oct 15, 2016 10:42 pm |
|
|
Thanks for the responses. As it turns out it seems that version 5.011 doesn't have this example file in it's library. As Jay mentioned, I have already looked at so many versions of doing this that my head is spinning. Is there any way to get a copy of the ex_dmx_slave.c file?
Mark |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19498
|
|
Posted: Sun Oct 16, 2016 1:17 am |
|
|
Talk to CCS.
Easiest honestly, upgrade the compiler. 5.011, is a rather early V5 compiler. |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9221 Location: Greensville,Ontario
|
|
Posted: Sun Oct 16, 2016 4:49 am |
|
|
If you ask CCS nicely, they may send it to you. They actually sent me the entire examples folder eons ago when I went from 2.5xx to 3.5xx. Yeesh, that was eons ago.....
Or just let Google find working 'slave' or rcvr' code. I've seen lots over the years. Essentially it's nothing more than a serial 'setup', get the data string, parse and then do 'whatever'.
Jay |
|
|
|