Posted by Arun
![]()
on 2/7/2011, 12:44 pm
122.165.63.144
Hello all,
I am working on a Galvo Scanner and I have a DMX control board that accepts DMX512 input. I am transmitting the DMX512 data (25 Channels) from PIC Microcontroller and using SN75176. I am nearly struggling out for about a week to sort out the problem and still do not have the solution. Here is my code that sends the Break, Mab, Sc and Channel data. Can anyone please tell me where I am making the mistake. Please
void sendbreak_mab_sc(void)
{
DMXOUT=1; // Mark time between Packet - Idle
delay_us(500); //Mark time between Packet - Idle
DMXOUT=0; // Break
delay_us(100); //Break
DMXOUT=1; // MAB
delay_us(8); //MAB
/*****************************************/
/* Start Code --- SC */
/*****************************************/
DMXOUT=0; delay_us(3); // 1 Start Bit
for(k=0; k<=7; k++) {DMXOUT=0;delay_us(3);}
DMXOUT=1;delay_us(3); DMXOUT=1; delay_us(3); // Stop Bit
return;
}
void sendchanneldata(void)
{
sendbreak_mab_sc();
for(j=1;j<=25;j++)
{
DMXOUT=1; // Mark time between Frame
delay_us(3); //Mark time between Frame
CH1=data_DMX[j];
DMXOUT=0; delay_us(3); // 1 Start Bit
for(k=0; k<=7; k++)
{
switch(k)
{
case 0:
DMXOUT=d1;
break;
case 1:
DMXOUT=d2;
break;
case 2:
DMXOUT=d3;
break;
case 3:
DMXOUT=d4;
break;
case 4:
DMXOUT=d5;
break;
case 5:
DMXOUT=d6;
break;
case 6:
DMXOUT=d7;
break;
case 7:
DMXOUT=d8;
break;
default:
break;
}
delay_us(3);
}
DMXOUT=1;delay_us(3); DMXOUT=1; delay_us(3); /* Stop Bits */
}
}
I am having the Channel data in an array (25).
Thousands of thanks.
Message Thread
![]()
« Back to index