cancel
Showing results for 
Search instead for 
Did you mean: 

UART on ST7

bleumers_j
Associate II
Posted on April 26, 2004 at 11:11

UART on ST7

8 REPLIES 8
bleumers_j
Associate II
Posted on April 22, 2004 at 05:37

Hi

I wrote software for an ST7LITE29 that converts DMX to 3 PWM outputs.

DMX is a asyncronous protocol at 250kHz and 9 bits per frame.

Since st7lite29 has got no uart, i wrote a software uast myself. It worked fine for a long time.

Now a protoserie is made, the software fails sometimes (small diffrence in resonator frequency...)

I'd like to change to an ST7 with an UART, so i can use the same software without the ''selfmade uart''

Any ideas

bleumers_j
Associate II
Posted on April 22, 2004 at 06:19

I removed a 'nop' instruction and the thing works again!

Maybe the code was changed by accident???

But now i'm doubting, is this a good way to word, should it be better to use a controller with a real uart???
sjo
Associate II
Posted on April 22, 2004 at 06:39

DMX512 as you said is a serial protocol - simply RS485 at 250kbaud.

That s quite a speed to handle in software, I think a better micro would be the ST72F264 which has a hardware uart.

Regards

sjo
jatin
Associate II
Posted on April 22, 2004 at 07:22

There is an application note available on this site for yor application i.e. AN1753 ''Software UART using ST7 12-Bit Autoreload Timer''.

bleumers_j
Associate II
Posted on April 22, 2004 at 07:49

Thanks for your fast responses.

The AN1753 -uart works up to 19200 Baud and DMX = 250000 Baud.

When i look at the datasheet of the ST72264G (i think this is the same as the ST72F264, you mentioned) i do not see an uart. In fact i do not find any st7 with an uart.

Greets
sjo
Associate II
Posted on April 22, 2004 at 08:49

ST call it an SCI

Regards

sjo
bleumers_j
Associate II
Posted on April 26, 2004 at 10:30

Hi,

Thanks for your help!

I have asked some samples of an ST7 with SCI.

But still one thing isn't clear yet:

To decode DMX the number of frames after the break should be counted. So this counter has te be resetted at each break.

How can i know when a break occurs? A break is handled as a framing error and a FE generates no interrupt. So, is the only way polling all the time the FE-bit and checking the SCIDR for value 0?

Thanks!
sjo
Associate II
Posted on April 26, 2004 at 11:11

A receive interrupt will be generated (RDRF), you can check for framing error in this interrupt. FE and RDRF bits will be set together.

Regards

sjo