RS-485 on 5i25+7i76/7i85

More
6 years 1 month ago #182942 by rumking
Replied by rumking on topic RS-485 on 5i25+7i76/7i85
Andy,
thank you for the answer.

I managed to get the UART going without the error message. But the mesa_uart component is not clear to me all the way.

The component is meant to send/receive up to 16B of data each servo-thread cycle, right? If I take a look at the 16 rx-data and 16 tx-data pins, they are all u32 type (4B unsigned integer = 0 to 4294967295).

Does that mean, that each of the pins can carry 4B of data (16*4 = 64B total), or are each of the pins supposed to carry 1B of data (16B total), so each of the pins should not take on value greater than 255?

I really appreciate your help guys.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #182959 by andypugh
Replied by andypugh on topic RS-485 on 5i25+7i76/7i85

rumking wrote: Does that mean, that each of the pins can carry 4B of data (16*4 = 64B total), or are each of the pins supposed to carry 1B of data (16B total), so each of the pins should not take on value greater than 255?.


I really can't remember.

The mesa_uart component isn't really intended to be used as-is, it is a sample / starter file to demonstrate the sort of thing that you can do.

The file is meant to be extremely simple, and relatively easy to understand.
github.com/LinuxCNC/linuxcnc/blob/master...ivers/mesa_uart.comp
Though i have just noticed that the comment for send and recieve is identical: copy-paste error.

The input pins are 32-bits but only the lower 8 bits are transmitted.

That probably isn't how you would do it in your own component.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #183164 by rumking
Replied by rumking on topic RS-485 on 5i25+7i76/7i85
Andy,
thank you once again.

I created a bitfile with 7i74 filled with UART (8 channels).

I managed to send and receive a bunch of bytes over the uart through channel 0 of the 7i74 (hm2_7i76.0.uart.0). But the issue is that it works just like a loopback (I get received the same bytes I send).

I think that this might be caused by that I tied RX+/TX+ and RX-/TX- together (because I need half duplex rs485). According to 7i74 manual:

RS-485 CAPABLE CHANNEL
Channel 7 of the 7I74 has an output enable and can be used for RS-485 half duplex
type applications. For 2 wire half duplex type RS-485 interfaces, the RX+ and TX+ lines
and the RX- and TX- lines should be tied together at the 7I74.

But when I use the channel 7 (hm2_7i76e.0.uart.7 as it is meant to be used for half-duplex rs485), I do not receive any bytes. I think I should *somehow* operate with the transmit enable pin, but I do not know how.

I also tried terminating the lines with 120ohm resistor without any progress (channel 0 still works as a loopback and channel 7 does not receive any bytes).

Do I miss something?

Or could you point me to a direction, how to operate with the transmit enable pin?

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #183165 by bevins
Replied by bevins on topic RS-485 on 5i25+7i76/7i85

rumking wrote: Andy,
thank you once again.

I created a bitfile with 7i74 filled with UART (8 channels).

I managed to send and receive a bunch of bytes over the uart through channel 0 of the 7i74 (hm2_7i76.0.uart.0). But the issue is that it works just like a loopback (I get received the same bytes I send).

I think that this might be caused by that I tied RX+/TX+ and RX-/TX- together (because I need half duplex rs485). According to 7i74 manual:

RS-485 CAPABLE CHANNEL
Channel 7 of the 7I74 has an output enable and can be used for RS-485 half duplex
type applications. For 2 wire half duplex type RS-485 interfaces, the RX+ and TX+ lines
and the RX- and TX- lines should be tied together at the 7I74.

But when I use the channel 7 (hm2_7i76e.0.uart.7 as it is meant to be used for half-duplex rs485), I do not receive any bytes. I think I should *somehow* operate with the transmit enable pin, but I do not know how.

I also tried terminating the lines with 120ohm resistor without any progress (channel 0 still works as a loopback and channel 7 does not receive any bytes).

Do I miss something?

Or could you point me to a direction, how to operate with the transmit enable pin?


I dont know about the mesa boards but with RS-485 half duplex, when your done transmitting, its got to revert to receive. You cant receive on a line set to transmit.

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #183167 by PCW
Replied by PCW on topic RS-485 on 5i25+7i76/7i85
Not sure what the hm2 driver does but typically for 1/2 duplex RS-485 you would set the RXmask so TXData was masked and only data from the remote device was received.

That said, the PktUART is more likely to be supported going forward

Please Log in or Create an account to join the conversation.

More
6 years 1 month ago #183265 by rumking
Replied by rumking on topic RS-485 on 5i25+7i76/7i85
Thank you for the suggestions.

I created a bitfile with 7i74 filled with PktUART.
hm2/hm2_7i76e.0: IO Pin 017 (P2-01): PktUART Receive Channel #0, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 018 (P2-14): PktUART Receive Channel #1, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 019 (P2-02): PktUART Receive Channel #2, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 020 (P2-15): PktUART Receive Channel #3, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 021 (P2-03): PktUART Transmit Channel #0, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 022 (P2-16): PktUART Transmit Channel #1, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 023 (P2-04): PktUART Transmit Channel #2, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 024 (P2-17): PktUART Transmit Channel #3, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 025 (P2-05): PktUART Receive Channel #4, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 026 (P2-06): PktUART Receive Channel #5, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 027 (P2-07): PktUART Receive Channel #6, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 028 (P2-08): PktUART Receive Channel #7, pin RX Data (Input)
hm2/hm2_7i76e.0: IO Pin 029 (P2-09): PktUART Transmit Channel #4, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 030 (P2-10): PktUART Transmit Channel #5, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 031 (P2-11): PktUART Transmit Channel #6, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 032 (P2-12): PktUART Transmit Channel #7, pin TX Data (Output)
hm2/hm2_7i76e.0: IO Pin 033 (P2-13): PktUART Transmit Channel #7, pin Drv Enable (Output)
When I try to loadrt the mesa_uart component now (loadrt mesa_uart names="hm2_7i76e.0.pktuart.0"), I get and error message:

Can not find UART instance hm2_7i76e.0.pktuart.0

I googled a little and I think that I could test the PktUART using the mesa_pktgyro_test component ( linuxcnc.org/docs/2.8/html/man/man9/mesa_pktgyro_test.9.html ). But I could not find the *.comp file anywhere (github, forum, etc.)

Could you provide the file to me, please?

Please Log in or Create an account to join the conversation.

Moderators: PCW, jmelson
Time to create page: 0.473 seconds
Powered by Kunena Forum