[En-Nut-Discussion] problem using fflush() (Klaus Kloos)

PragmaLab (Rob van Lieshout) info at pragmalab.nl
Sat Oct 22 13:26:36 CEST 2011


> Hello
>
> Im on a SAM7-EK using ethernut 4.10rc1
> For sending DMX (250k, 8N2) I need to send a 0x00 at 9600 baud (Reset),
then switch to 250kbaud and send the frame.
> After sending with 9600 I use fflush(), but its not working as (I)
expected.

Hello Klaus,

Not sure why you want to create the break and mark-after-break  for the DMX
output this way, using the 9600 baud UART. Timing is never exact (although I
haven't looked into your 'fflush' problem).

Try configuring the Tx-pin of your UART as a normal output pin, generate the
break and mark-after-break sequence with the use of a timer (exact timing)
and then (re)configure the pin as UART Tx-pin again (250 kbBaud). For my DMX
projects I always use this method and it's working fine.

Regards,

Rob van Lieshout
PragmaLab




More information about the En-Nut-Discussion mailing list