pktUART setup help

More
10 Nov 2021 01:48 #225906 by ExcessiveO
Can someone help me out with setting up a pktUART interface? I am trying to interface to an Odrive over rs422, I have the tranceiver hooked up correctly(at least it appears to be). I can send data from linuxcnc to the Odrive, but am having a tough time being able to read any data the other way. I keep getting either "no new frames" or "overrun error, no stop bit". I'm thinking I don't have the rx and tx registers set correctly or I'm not clearing the buffers when they should be. It is supposed to send a single frame of control data and then read back ~8 bytes. Any help on the order of what functions to call and what setup parameters to use would be appreciated.

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

More
10 Nov 2021 17:02 #226014 by PCW
Replied by PCW on topic pktUART setup help
I suspect the lower level PktUART driver does not deal with the conditional reads required
to receive packets correctly. In addition the overrun error suggest a data length error

Since only one read function is done per thread, the RX driver must first read the mode
register to determine if packets are available (and how many are available), then on the _next_ read function invocation it must read the packet count(s) from the recieve count
FIFO then on the next read function the data corresponding to the received packets
must be read.

This 3 step process could be simplified to 2 steps if reading the receive count FIFO
when empty did not cause a FIFO error. If this were the case, the read function
could read the mode register and the receive count FIFO every time and only read data
on the next read function if there were packets available

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

More
18 Jan 2022 00:25 #232203 by ExcessiveO
Replied by ExcessiveO on topic pktUART setup help
I found the issue, the pktuart driver only sets 16 bits of the 32 bit rx mode register. Bits 22-29 are for the filter time and were set to zero. I changed the driver to send 32 bits and changed the rx mode value to 0x25801408 (115200 baud rs422). It appears to have fixed all the errors I was getting.
The following user(s) said Thank You: tommylight

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

More
18 Jan 2022 10:14 #232251 by tommylight
Replied by tommylight on topic pktUART setup help
Thank you for reporting back.

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

More
19 Jan 2022 17:38 #232452 by ExcessiveO
Replied by ExcessiveO on topic pktUART setup help
I am now having an issue with running multiple pktuart instances at once, when they are initialized at the beginning, it appears the names are all set correctly, but after they start running, data is only being sent to first instance. It isn't sending anything to the others.

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

More
19 Jan 2022 18:56 #232471 by rodw
Replied by rodw on topic pktUART setup help
Maybe I'm way off the mark.
I'm wondering how multiple instances could work when a mesa card only has one UART. You can't just make another one in software.

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

Time to create page: 0.180 seconds
Powered by Kunena Forum