AnsweredAssumed Answered

dmx512 transmitter

Question asked by mahmoud boroumand on Jul 24, 2017
Latest reply on Jul 25, 2017 by Vangelis Fortounas

Hello 

 

I useing stm32f103c8(72mhz) and i want create DMX512 transmitter for  led lighing.

I have some problem.I config usart like this.

USART_InitStructure.USART_BaudRate = 250000;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_2;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Tx;
USART_Init(USART2, &USART_InitStructure);

 

when i make reset sequence and data with this code.

_delayus(20);///MarkBeforeBreak
USART_SendBreak(USART2);//Break
_delayus(12);//MarkAfterBreak;
USART_SendData(USART2,0);///start code

for(int i=0;i<512;i++)

{  

USART_SendData(USART2,255);//R

USART_SendData(USART2,255);//G

USART_SendData(USART2,255);//B

_delayus(12);//MTBP

}

 

I have some problem with this code.

1-Break time is 44us but dmx need 92us at least how can solve this problem?

2-Is structure right for dmx led light?

Thanks

Outcomes