Recent

Author Topic: Please help with the CH341DLL  (Read 1646 times)

MarkMLl

  • Hero Member
  • *****
  • Posts: 5923
Re: Please help with the CH341DLL
« Reply #15 on: January 04, 2023, 01:06:03 pm »
I think the bottom line is that it's an installation issue of some sort. OP: leaving aside Lazarus/FPC issues for the moment, how did you get the driver and DLL onto your system? Did you rely on OS-driven installation, or did you try copying things manually?

The CH341 is effectively and USB to Serial chip.

I also see in you ZIP mention to PCA9685 which is a 16 Channels Servo Driver

Is this the board you try to communicate with?

It's a combined serial, I2C and SPI interface, and I believe the board he's talking to is I2C. I posted some relevant links earlier.

I've used this, just not on Windows.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Dzandaa

  • Jr. Member
  • **
  • Posts: 96
  • From C# to Lazarus
Re: Please help with the CH341DLL
« Reply #16 on: January 04, 2023, 03:33:29 pm »
Hi again,

The CH341DLL.DLL is a 32 bits DLL.

I presume that your OS is 64 Bits (Windows 10)

Maybe you have to compile your programs in 32 bits mode/

You have to install the Add-On for building and debugging 32bit Windows applications:
lazarus-2.0.10-fpc-3.2.0-cross-i386-win32-win64.exe
This file can be installed as add-on to the 64 bit Lazarus IDE (on Systems with Windows 64 bit only),
if you wish to develop for 32bit Windows too.

https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%202.0.10/

And change Project->Compiler Options ->Config and Target->Target OS->win32

I also have problems with the CH341 driver in Linux as it's only an USB Driver.

Good luck  ::)

B->
Dzandaa

MarkMLl

  • Hero Member
  • *****
  • Posts: 5923
Re: Please help with the CH341DLL
« Reply #17 on: January 04, 2023, 04:16:19 pm »
I also have problems with the CH341 driver in Linux as it's only an USB Driver.

Well of course it's a USB driver... that's the whole point of the blooming thing!

Or do you mean it's only serial, and you want I2C etc.?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Dzandaa

  • Jr. Member
  • **
  • Posts: 96
  • From C# to Lazarus
Re: Please help with the CH341DLL
« Reply #18 on: January 04, 2023, 04:33:29 pm »
Hi,

I know it's an USB driver :)

I just mean that I wanted I2C etc...

But it was a long time ago :)

Now I'm on other projects.

B->
Dzandaa

MarkMLl

  • Hero Member
  • *****
  • Posts: 5923
Re: Please help with the CH341DLL
« Reply #19 on: January 04, 2023, 04:40:55 pm »
I just mean that I wanted I2C etc...

Fine. So for Windows see the Hackaday link I posted earlier, or for Linux see my repo on GitHub (link in my sig).

For anybody who arrives here via Google etc.: the I2C Linux kernel module doesn't handle address scanning very well, for reason's nobody's been able to work out. Apart from that it's fine: generally looks like a useful little chip and is heavily used by people- on both Linux and Windows- who need to interface to SPI memory etc.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sabouras

  • New Member
  • *
  • Posts: 18
Re: Please help with the CH341DLL
« Reply #20 on: January 04, 2023, 08:49:27 pm »
Dear All,
thank you for your advice.
I remove the lazarus from my computer and install the 32bit version of lazarus as mentioned.
Now it seems to working (at least detect if the device is plugged).
Thank you for your help.
Best regards to all.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5923
Re: Please help with the CH341DLL
« Reply #21 on: January 04, 2023, 09:31:06 pm »
Dear All,
thank you for your advice.
I remove the lazarus from my computer and install the 32bit version of lazarus as mentioned.
Now it seems to working (at least detect if the device is plugged).
Thank you for your help.
Best regards to all.

Well done, and please keep us informed of how you get on.

I suspect that my earlier mention of Hackaday etc. was misleading, since re-reading the article plus some of the links suggests that it applied to Linux rather than Windows- which was obviously also the case for the kernel modules I did a bit of work on.

Roughly translated: as far as Windows support for that (very useful) chip is concerned, you're now the Local Expert :-)

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

TRon

  • Hero Member
  • *****
  • Posts: 834
Re: Please help with the CH341DLL
« Reply #22 on: January 05, 2023, 05:56:31 am »
I've got the hardware. But I'm not messing around with an undocumented DLL etc. for an OS I don't use.
MarkMLl
In that case I stand corrected: the odds must be closer to 2 to 20260  :) (I should have checked first)  :-[

Quote
But I'm not messing around with an undocumented DLL etc. for an OS I don't use.
Fair enough and not a problem.

Yes, you're right, it's a 32 bit dll. I made an elementary mistake, here is my method:
No problem GetMem. Mistakes like that happen to everyone my dear Watson ;)

fwiw I'm on Linux so a readpe/file from a terminal window did the trick for me. Nice method though.


@sabouras: Thank you for reporting back.

Dzandaa

  • Jr. Member
  • **
  • Posts: 96
  • From C# to Lazarus
Re: Please help with the CH341DLL
« Reply #23 on: January 05, 2023, 11:29:06 am »
Hi Sabouras,

For Info: no need to uninstall the 64 Bit version, just install the addon:
lazarus-2.0.10-fpc-3.2.0-cross-i386-win32-win64.exe


So you can compile for 64 bit and 32 bit.

B->
Dzandaa

 

TinyPortal © 2005-2018