- Posts: 19306
- Thank you received: 0
Simple UART on Mesa 6i25 with 5i25 firmware
Indeed, it is better to remove the call to hm2_module_is_consistent_or_complain from the uart.c driver.sirop wrote:
would not help.It might be simplest just to comment out the "return -EINVAL" so that you get the warning but execution continues.
Please Log in to join the conversation.
It just means you need to set the proper instance stride in the vhdl file
Please Log in to join the conversation.
PCW wrote: Actually there's no problem at all unless you need to _combine_ Sserial or BSPI with the UART
It just means you need to set the proper instance stride in the vhdl file
Is x"10" the proper instance stride if only UARTTTag and UARTRTag are needed?
Please Log in to join the conversation.
InstStride1: integer := 64; -- instance stride 1 = 64 bytes = 16 x 32 bit registers !! UARTS need 0x10
-- InstStride1: integer := 16; -- instance stride 1 = 64 bytes = 16 x 32 bit registers !! UARTS need 0x10
Please Log in to join the conversation.
PCW wrote: Actually there's no problem at all unless you need to _combine_ Sserial or BSPI with the UART
It just means you need to set the proper instance stride in the vhdl file
I finally understood what you meant.
As all the other pins in my case have InstStride0: integer := 4, I just comment out InstStride1: integer := 64
and use InstStride1: integer := 16 instead.
Then I do not need to edit hostmot2.c.
Just rebuilt the firmware and it worked.
Thanks.
Please Log in to join the conversation.
I am looking at int hm2_uart_setup(char *name, int bitrate, rtapi_s32 tx_mode, rtapi_s32 rx_mode) .
What does this line and its comment mean:
Ok, 1048576=2^20, so we get a buffer size for a given bitrate and clock frequency.
But is the meaning of the comment?
Is it the driver version which is meant?
Or is it also the Mesa card model which is meant?
Thanks.
Please Log in to join the conversation.
sirop wrote: But is the meaning of the comment?
Is it the driver version which is meant?
I imagine so, It is probably based on something in the regmap file.
Please Log in to join the conversation.
That means that the baud rate register value needs to be set to baudrate*2^20/Clock
(Phase accumulators are used for baud rate setting rather than the more normal programmable
dividers because I wanted high resolution baud rate sett-ability at high baud rates and programmable dividers
dont do this well)
Please Log in to join the conversation.
- pmcstoneinc
- Offline
- Junior Member
-
- Posts: 37
- Thank you received: 0
(3000000 * 2^20) / 5000000 = 62914.56 ??
Let me know. Thanks.
Please Log in to join the conversation.
pmcstoneinc wrote: With that being said whats the bit rate value for 3Mbps on a 7i92 (50Mhz clock low?)
(3000000 * 2^20) / 5000000 = 62914.56 ??
Let me know. Thanks.
You set the baud rate [= bit rate] as you need it. UART should do up to 10 Mbit/s.
Do not forget about the start and stop bits.
Maybe, you would do better with Packet UART on that frequency?
I prepared PktUART for machinekit: see the latest commits beginning from github.com/sirop/machinekit/commit/3446d...ee7211f94f1a1a2462d5
To use them with LinuxCNC you'll only need to subsitute u8, u16 and so on with rtapi_u8, rtapiu_16 ....
as I see it.
Please Log in to join the conversation.
