2010-08-19 10:03:48 Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92584
Hi,
I'm trying to use RS485 over the SPORT1, the trasmit/receive mode is supposed to be driven by the TRS pin of the sport.
When I write data to /dev/ttySS1, the TRS isn't really looking like a "transmit enable". Is it supposed to work "out of the box" ? or I need to modify the driver ?
Thanks,
Julien
QuoteReplyEditDelete
2010-08-19 10:20:28 Stamp BF537, SPORT1 RS485
Michael Hennerich (GERMANY)
Message: 92586 I used this driver in for RS485 purposes before -
But I think you need some pull-up resistors.
Try to search the forums - I think you should find some information.
-Michael
QuoteReplyEditDelete
2010-08-19 11:44:58 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92589
I verified all my pull-up/pull-down it's looking fine.
Here a capture of what I have : people.apache.org/~jvermillard/rs485.png
BLUE is data out
RED is TRS supposed to be barred DE.
Why when not transmitting it's not back to receiving ?
QuoteReplyEditDelete
2010-08-19 12:41:04 Re: Stamp BF537, SPORT1 RS485
Michael Hennerich (GERMANY)
Message: 92592 What kernel version are you using?
I think I fixed this 16 months ago -
blackfin.uclinux.org/gf/project/linux-kernel/scmsvn/?action=browse&path=%2F&view=rev&revision=6209
-Michael
QuoteReplyEditDelete
2010-08-19 13:08:58 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92593
My revision :
URL: svn://blackfin.uclinux.org/linux-kernel/trunk/drivers/serial
Repository Root: svn://blackfin.uclinux.org/linux-kernel
Repository UUID: 526b6c2d-f592-4532-a319-5dd88ccb003d
Revision: 8602
Node Kind: directory
Schedule: normal
Last Changed Author: bhsong
Last Changed Rev: 8528
Last Changed Date: 2010-03-22 10:37:11 +0100 (Mon, 22 Mar 2010)
QuoteReplyEditDelete
2010-08-19 13:33:09 Re: Stamp BF537, SPORT1 RS485
Michael Hennerich (GERMANY)
Message: 92594 Looking at trunk head - someone reverted this fix.
Can you try with the TCR1 settings from my patch?
-Michael
QuoteReplyEditDelete
2010-08-19 13:40:24 Re: Stamp BF537, SPORT1 RS485
Mike Frysinger (UNITED STATES)
Message: 92595
svn rev 6782 by Sonic ...
QuoteReplyEditDelete
2010-08-20 04:01:51 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92618
Thanks, now the signal looks much better.
I plugged a RS485/232 converter and I receive, but only wrong chars. The baud rate settings was fubared too ?
I'm going to test withanother converter before pugging a logic analyzer.
QuoteReplyEditDelete
2010-08-20 04:32:47 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92620 The bit lengths are 17,62µs which is corresponding to 57600, I don't understand why my console is scrambled. This was tested recently ? �W=;'5�= ����������QҪڿ!3�ysm�9/- ��������Ӆ! � = - -!#� = -#1�#! �= =-'=;'5��� %= �3'= /��������������������������������������;!! '!=75 �#! ������������������������������������'-# �)5'���#! ������������������������������������'-# �)5'���#! �������������3����������������������e}y�}77 5 �#! �������i*� -�;3-#� -����{'=9)3-#�!#�9/- �Y_m�y!# !''5 �w - 5 ��S5 -!#������ 51 A;= 5339�������7%=�9/=##5'������i
QuoteReplyEditDelete
2010-08-20 06:18:59 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92623
I changed my serial port parameters like that : stty -F /dev/ttySS1 ispeed 57600 ospeed 57600 cs8 -icrnl -ixon igncr -opost -onlcr -isig -icanon -iexten -echo -echoe -echoke -hupcl -echoctl min 1 time 0
I just do a echo " " > /dev/ttySS1
Here the scope capture :
people.apache.org/~jvermillard/capture4.png
BLUE is DTxPRI
RED is TFSx
well if you count bits it's wrong, it's in revert order and inverted.
QuoteReplyEditDelete
2010-08-20 08:08:18 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92628
Here my modified setup in function sport_uart_setup(...) :
SPORT_PUT_TCR1(up, (LATFS | ITFS | TLSBIT | ITCLK));
QuoteReplyEditDelete
2010-08-20 08:15:55 Re: Stamp BF537, SPORT1 RS485
Michael Hennerich (GERMANY)
Message: 92629 Do you still think the bits are shifted out in reversed order?
If yes - I think Sonic needs to take a look -
He's done most of the rework recently.
-Michael
QuoteReplyEditDelete
2010-08-20 08:29:08 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92631
Yes,
for example transmitting 'U' works. U is 0x555 so 01010101 is binary
So if you revert the order you have : 10101010 and you do the 1 complement you are back to 0x55 so 'U'.
If you try to transmit something else you have weird chars. I'm not sure but I think there is a problem on the stop bit too.
If it was modified recently I'm curious to know if it was tested. I never digged in SPORT configuration and I'm pretty new to DSP so debugging that myself will be pretty tedious.
Thanks for your support,
Julien
QuoteReplyEditDelete
2010-08-20 10:28:11 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92641
I plugged a logic analyzer in UART mode, configured for 57600, it's see corretly the start bit but then the data are wrongs.
I start to think something is really broken in the driver.
QuoteReplyEditDelete
2010-08-20 12:39:28 Re: Stamp BF537, SPORT1 RS485
Mike Frysinger (UNITED STATES)
Message: 92645
try removing TLSBIT from the TCR register then ?
QuoteReplyEditDelete
2010-08-23 03:51:20 Re: Stamp BF537, SPORT1 RS485
Julien Vermillard (FRANCE)
Message: 92685
no sucess
QuoteReplyEditDelete
2010-08-23 03:57:37 Re: Stamp BF537, SPORT1 RS485
Mike Frysinger (UNITED STATES)
Message: 92686
ok, but is that the same as "no difference in signal output" ?
QuoteReplyEditDelete
2010-08-23 04:27:58 Re: Stamp BF537, SPORT1 RS485
Sonic Zhang (CHINA)
Message: 92687
I changed my serial port parameters like that : stty -F /dev/ttySS1 ispeed 57600 ospeed 57600 cs8 -icrnl -ixon igncr -opost -onlcr -isig -icanon -iexten -echo -echoe -echoke -hupcl -echoctl min 1 time 0
I just do a echo " " > /dev/ttySS1
Here the scope capture :
people.apache.org/~jvermillard/capture4.png
BLUE is DTxPRI
RED is TFSx
well if you count bits it's wrong, it's in revert order and inverted.
---
I guess you mean
RED is DTxPRI
BLUE is TFSx
I don't see error on your picture. The SPORT UART driver shifts LSB first, which works well with UART protocol.
Do you receive data over RS485 in MSB mode? If so, you should change the TLSBIT as well in the current driver.