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

More
6 years 1 month ago #183302 by PCW
Replied by PCW on topic RS-485 on 5i25+7i76/7i85
its here:

src/hal/components/mesa_pktgyro_test.comp

pktuart.c should probably be updated to match the latest firmware that now supports parity
The new firmware should be ok with the existing driver because the parity enable bit is set to 0
(disabled) by the existing driver.

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

More
6 years 1 month ago #183737 by rumking
Replied by rumking on topic RS-485 on 5i25+7i76/7i85
I was able to start linuxcnc with the pktgyro component loaded, everything seems to be fine. But while the machine is running I am getting an error:

hm2: hm2_7i76e.0.pktuart.0: Overrun error, no stop bit

From what I was able to gather, the error has errno 111 (defined in /src/hal/drivers/mesa-hostmot2/pktuart_errno.h):

#define HM2_PKTUART_RxOverrunError (111) // Overrun error (no stop bit when expected) (sticky), Bit 1

I think it may be caused by wrong bit mask "rtapi_s32 rx_mode" of the hm2_pktuart_setup function ( linuxcnc.org/docs/2.8/html/man/man3/hm2_pktuart_setup.3hm2.html ):

int hm2_pktuart_setup(char *name, int bitrate, rtapi_s32 tx_mode, rtapi_s32 rx_mode, int txclear, int rxclear)

If I am on the right path, bit 1 of the rx_mode bit mask should be the problem. According to the manual:
Bit 1 : Overrun error (no stop bit when expected) (sticky)

I am not sure if I got it right: When the bit 1 of the rx_mode bit mask is set to 1, the stop bit is expected or vice versa?
I also could not find whether the bit 0 of the bit mask is the MSB or LSB.

Thank you guys.

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

More
6 years 1 month ago #183743 by PCW
Replied by PCW on topic RS-485 on 5i25+7i76/7i85
This is not related to masking, is more like due to a polarity error or
lack of RS-485 biasing to insure an idle line state when not driven.

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

More
6 years 1 month ago #184290 by rumking
Replied by rumking on topic RS-485 on 5i25+7i76/7i85
Hi Peter,
thank you for the suggestion. According to this scheme:
www.ni.com/images/support/us/bias.gif

I used 120R terminating resistor and 1k bias resistors (I dont know whether the 1k is not too large...).

Anyway, the error "hm2: hm2_7i76e.0.pktuart.0: Overrun error, no stop bit" went away. But now, I am getting another error message:

hm2: Can not find PktUART instance X�߾<�ߵ�V�.

The weird characters are probably some unicode... I took a screenshot of the error message, here:
pasteboard.co/Jtkulbj.png

In halmeter, the pin hm2_7i76e.0.pktuart.0.rxbytes gives a value of -22. Which indicates an errno 22. However, I cannot find the errno in pktuart_errno.h.

Do you have any idea what is going on?

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

More
6 years 1 month ago #184292 by PCW
Replied by PCW on topic RS-485 on 5i25+7i76/7i85
The first error looks like some kind of driver bug
not sure any further errors have any meaning after the first

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

More
6 years 4 weeks ago #184604 by rumking
Replied by rumking on topic RS-485 on 5i25+7i76/7i85
Peter, thank you. The issue really was caused by the driver (my C-programming skills are not that great).

Anyway, I got another error:
hm2_7i76e.0.pktuart.0hm2_eth: ERROR: used llio->read in realtime task (addr=0x6400)
hm2_eth: This causes additional network packets which hurts performance

I think that the issue is caused by the driver also, but I have no clue, what this message means. Could you, please, give me a suggestion?

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

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