Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
Serial Ports / Re: D Tech DT-5019 is slow
« Last post by jvh24521@gmail.com on February 13, 2023, 02:25:28 pm »
Thanks for the suggestion Jan.

Interesting results. I had assumed the converter had termination resistors, why would it not, I thought. Since it has a D9 connector that mates to a cable I thought the resistors should be in the device, not my cable connector. So I added the termination resistors and set the baud for 115200. It worked, in a way. I am no longer getting errors on the echoed characters but the overall transfer rate is still the same, about 1000 Mbps. So now that I can get the desired bit rate I need to look elsewhere. I have Visual Studio C++ and TI CCS both running on the same PC, a Dell Precision 7760. Both task are using the same USB 3.0 hub but I would not think that a problem. My next step will be to let these tasks write a character in a tight loop and look at it with a scope, then go from there. Maybe my Atolla hub is not all it claims to be.
42
USB / enumerate VID/PID/WinUSB DeviceInterfaceGUID on Windows - robust code?
« Last post by rdebaene on February 09, 2023, 03:28:41 pm »
Both the book "USB Complete" and the demo project winusb_cs_31 use VID/PID for detecting device insertion/removal (via WMI) and the DeviceInterface GUID for accessing WinUSB devices.

I couldn't find example code to link VID/PID to DeviceInterface GUID and vice versa, so I tried to write my own code. See attachment (.NET Framework, C#, VS2019).
  • Is this the right method to link both, or are there simpler methods?
  • Can others test if it works on their system, especially in foreign languages? The code assumes ASCII or UTF16 encoding in some places, not sure if this is always correct.

Kind regards,

Renaat
44
Serial Ports / D Tech DT-5019 is slow
« Last post by jvh24521@gmail.com on February 07, 2023, 10:32:44 pm »
I am using a D Tech DT-5019 USB to RS-422/485 converter which is connected to the D9 patch board that came with it. Connected to the patch board is about 1 ft of ethernet cable that connects to my target board via an RJ-45 connector using a 4 wire plus ground connection. It will not communicate reliably above 9600 baud.

Any similar experience or suggestions?

Thanks,
John
45
Serial Ports / Re: PIC to PIC synchronization
« Last post by Renate on January 27, 2023, 09:10:28 pm »
One protocol to use would be MODBUS.
It's not rocket science but it is standardized.
If you're talking on a bus it's good to have a bit of error detection and knowing how long a message is so you can turn around the direction and respond.
Sure, you could make your own standard, but why?

I'm running a Raspberry Pi with RS-485 to a dozen nodes.
The first one already happened to be MODBUS, so I stuck with it.

There's also CANBUS, but it's a bit more tricky to deal with.
46
Serial Ports / Re: PIC to PIC synchronization
« Last post by Jan Axelson on January 12, 2023, 09:50:55 am »
If each device has a single UART, you'll need to use a hardware networking interface such as RS-485 to connect them all.

One way to manage communications is to have one device control the communications. For example, assign an address to each device. The controlling device polls each device in turn, including the address in the communication to identify the intended receiver. The other devices send data only when polled.
47
Serial Ports / PIC to PIC synchronization
« Last post by titan2020 on January 12, 2023, 09:39:36 am »
Hello,

I'm building a project. That consists of 3 PCBs, each with a PIC. The PIC on one of the boards must send and receive multiple bytes of data to and from the other 2 PICs as well as a PC. All transfers use the on board UARTs. I'm looking for algorithm ideas to synchronize these transfers so that data does not get scrambled and gets to the appropriate device.

Thank you,
Steve   
48
USB / Re: USB binterval
« Last post by Jan Axelson on December 16, 2022, 05:34:37 pm »
Check to see if audio 2.0 has additional required class requests.
49
USB / bug in my winusb_cs code for some non-US users
« Last post by Jan Axelson on December 09, 2022, 11:44:53 am »
A user reported this bug in my winusb_cs code for some non-US users:

The Windows version check fails with "FormatException: input was not in correct format" for users where the decimal separator is a comma, e.g. in some European countries. The exception is thrown around line 742 of frmMain.cs:

var windowsVersion = Convert.ToDecimal(completeWindowsVersion.Substring(0, 3));

And the fix is:

var windowsVersion = Convert.ToDecimal(completeWindowsVersion.Substring(0, 3), CultureInfo.InvariantCulture);

It's also needed to add "using System.Globalization;" at the top of the file.

That's because "completeWindowsVersion" always uses a point as separator (e.g. "6.3.9600.0"), but Convert.ToDecimal() uses by default the local decimal separator for conversion.


The code is here:

http://janaxelson.com/winusb.htm
50
USB / Re: Understanding HID communication
« Last post by Renate on November 20, 2022, 10:27:40 am »
Thanks -- but I was asking about the 3 bytes before the data packet.  69  81  58
In LSB first order you've got 4 bits of PID, 4 bits of ~PID, 7 bits of address, 4 bits of endpoint and 5 bits of CRC
Code: [Select]
1 0 0 1 0 1 1 0   1 0 0 0 0 0 0 1   0 0 0 1 1 0 1 0
IN----- ~IN----   Device1------ End1----- CRC------
Pages: 1 ... 3 4 [5] 6 7 ... 10