|
|
View previous topic :: View next topic |
Author |
Message |
MiB1986
Joined: 05 Jun 2007 Posts: 3 Location: UK
|
Hello, can someone please help me with DMX |
Posted: Wed Jun 06, 2007 8:08 am |
|
|
Hiya,
I am looking to see if you can help, for several years now ive used picaxe, from www.picaxe.co.uk, and this is unfortunately too slow for DMX... as it works on token, but is great for things which do not require fast programs.
I would like to move onto DMX and this means upgrading into an intrupiter, i managed to make a DMX transmitter using one of there processors based upon a pic16f88 and it worked fine, i did this by slowing down for the break and then speeding up for the transmit. etc anywayz
I am completely new to this side of programming in extreme, ie i only know how to turn on and off a few LED using CCS complier and native pic micro,
but what i am after if possible is an example of a DMX reciever which is able to recieve 1 channel of DMX, obviously this channel id choose within the universe.
I intended to do this using a DIP switch, 8 way, and then simply reading portb say to a variable and then using that variable value as the DMX addres, would it work in your opinion?
Basically for now, is it possible to provide me with a DMX reciever code, and a DMX Transmitter code please.... as well as the processor information it will work on.
This code only has to work, and perhaps just store the DMX value recieved in a variable so later i can just use a compare statment and say if value is in the range of... do this etc...
I would perferbily like the resonator to be inside the processor for ease of use, although i do know they are not as acturate so an external is easily considered,
Please can you help, i understand and appreciate this is maybe a tall order.
If you are not able to provide full code, can you please tell me what devices would work with the code posted on the forum previously
I understand about the break, the header etc... i just cant get what i am used to using recieving and storing the data that fast.
Kind Regards....
Martyn |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
MiB1986
Joined: 05 Jun 2007 Posts: 3 Location: UK
|
Hello, Can you help with DMX |
Posted: Wed Jun 06, 2007 2:04 pm |
|
|
I have read it,
But how do i convert it?
Is there a way to convert it?
Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Jun 06, 2007 2:23 pm |
|
|
If you know both CCS and ASM (even a little bit of ASM), then you
can convert it. For example, look at this file:
DMX512TrmtDemo.asm
The first part of it consists of CONFIG statements. In CCS, those
are settings are done with a #fuses statement.
Next come two #define statements:
Code: |
#define T100US .256-.100
#define T60US .256-.60
|
Translated to C:
Code: |
#define T100US (256 - 100)
#define T60US (256 - 60)
|
Next there are several variable declarations:
Code: |
CBLOCK 0x008
DmxTxState
CountH
CountL
TxBuffer: .512
ENDC
|
Translated to C:
Code: |
int8 DmxTxState;
int8 CountH;
int8 CountL;
int8 TxBuffer[512];
|
It's possible that the two Count variables could be written as:
I'd have to look at how it's used in the code.
Then the code starts:
Code: |
ORG 0x0000
Main
rcall InitTX
rcall SetupSerial
rcall SetupADC
MainLoop
rcall DMXTransmit
rcall CheckADC
goto MainLoop
|
Translated to C:
Code: |
void main()
{
InitTX();
SetupSerial();
SetupADC();
while(1)
{
DMXTransmit();
CheckADC();
}
|
After that point it starts to require more work, but it could be done.
You need to have a good knowledge of CCS and at least some
knowledge of MPASM. |
|
|
MiB1986
Joined: 05 Jun 2007 Posts: 3 Location: UK
|
|
Posted: Wed Jun 06, 2007 3:01 pm |
|
|
unfortunately, i dont have these skills yet,
if i knew how to write in ASM i woud not bother with C, therefore am unable to covert it to C
Thanks for your help though and your time to reply... |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|