makerbase-mks / CANable-MKS

157 stars 41 forks source link

canable2 gs_usb SetCAN baudRate #7

Open monkeyish-smart opened 3 months ago

monkeyish-smart commented 3 months ago

hello, I had some problems using MKS CANable V2.0。 1.about"BUSMASTER_Installer_Ver_3.2.2-cantact", I set baudRate 500k test normal,but set 100k Software crash。The supported baud rate types are not complete, Is there any plan to open source busmaster_installer_ver_3.2.2-contact?

  1. about baudRate,BUSMASTER send 00 0b 08 01 11,but theoretical calculating value:170000000/((17+1)*(1+8+11))=472,222k,Wide margin of error.Maybe I'm not understanding this right. I know that this can be delivered by libusb_control_transfer 0x41 0x01 command with the following structure。Can you provide a range for correctly setting the baudRate value? eg, phase_seg2? and phase_seg1 and so on, typedef struct { unsigned int prop_seg; unsigned int phase_seg1; unsigned int phase_seg2; //1~16? unsigned int sjw; unsigned int brp; }GSCANDeviceBitTiming;
monkeyish-smart commented 3 months ago

I got it wrong 170000000/((17)*(1+8+11))=500k,but 800kbps is difficult to calculate for 170M main frequency. "BUSMASTER_Installer_Ver_3.2.2-cantact" is right,but 125k or 100k Software crash,These baud rates are commonly used。