Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

Adding GPIO functionality to a Linux desktop computer
Adding GPIO functionality to a Linux desktop computer
Adding GPIO functionality to a Linux desktop computer Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 1st December 2018, 05:25 AM   #11
booomerang is offline booomerang  United States
diyAudio Member
 
Join Date: Jan 2013
I thought the ch341.ko usb-uart module was interfering so I renamed and removed it so only i2c_ch341_usb.ko module was loaded, but still no luck. I had tried to manually export the gpio pins, no luck either as it was not allowed.
  Reply With Quote
Old 1st December 2018, 05:21 PM   #12
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
Quote:
Originally Posted by booomerang View Post
I bought an CH341A board hoping to replicate this USB gpio functionality. On my machine I could not see gpio files populated in /sys/class/gpio directory. Could you please look if my system is different from yours ? I pretty much followed the same instructions as you did.
I see the following:

from dmesg:
Code:
[1270446.717891] usb 1-1.4: new full-speed USB device number 6 using xhci_hcd
[1270446.834772] usb 1-1.4: New USB device found, idVendor=1a86, idProduct=5512
[1270446.834777] usb 1-1.4: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[1270446.940506] i2c_ch341_usb: loading out-of-tree module taints kernel.
[1270446.940575] i2c_ch341_usb: module verification failed: signature and/or required key missing - tainting kernel
[1270446.940917] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: output gpio0 gpio=0 irq=0
[1270446.940920] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: output gpio1 gpio=1 irq=1
[1270446.940923] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: output gpio2 gpio=2 irq=2
[1270446.940925] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: output gpio3 gpio=3 irq=3
[1270446.940928] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: input  gpio4 gpio=4 irq=4 (hwirq)
[1270446.940930] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: input  gpio5 gpio=5 irq=5
[1270446.940933] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: input  gpio6 gpio=6 irq=6
[1270446.940935] i2c-ch341-usb 1-1.4:1.0: ch341_cfg_probe: input  gpio7 gpio=7 irq=7
[1270446.941117] i2c-ch341-usb 1-1.4:1.0: ch341_i2c_probe: created i2c device /dev/i2c-9
[1270446.941120] i2c-ch341-usb 1-1.4:1.0: ch341_i2c_set_speed: Change i2c bus speed to 100 kbps
[1270446.943782] i2c-ch341-usb 1-1.4:1.0: ch341_usb_probe: connected
[1270446.943941] usbcore: registered new interface driver i2c-ch341-usb

From lsusb:
Code:
Bus 002 Device 002: ID 174c:3074 ASMedia Technology Inc. ASM1074 SuperSpeed hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 006: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter
Bus 001 Device 002: ID 174c:2074 ASMedia Technology Inc. ASM1074 High-Speed hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
I only know that what I did works for the Electrodragon board. I can't say with 100% certainty that it will work for other CH341A boards. Maybe, possibly, but not 100% sure.

I would re-read the instructions about how to insert the CH341 kernel module and maybe you will find some place where you made a mistake. If not, just order a few of the Electrodragon boards (they are cheap!).

I think there was some other info about different CH341 boards that were tried on that Zoobab web page:
CH341 USB SPI I2C UART ISP dongle - .[ZooBaB].
You might look that over, too.
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins
  Reply With Quote
Old 2nd December 2018, 03:07 AM   #13
booomerang is offline booomerang  United States
diyAudio Member
 
Join Date: Jan 2013
Finally, I was able to enable GPIO and IIC functionality by bridging a solder pad underneath the board, here is what it looks like and the ACT + GND needs to be shorted to enable GPIO+IIC. There are also TEN+GND and V3+3V3 but they don't make a difference:

Click the image to open in full size.

On startup, it looked like this
Code:
[ 2054.703580] usb 3-6: New USB device found, idVendor=1a86, idProduct=5512
[ 2054.703587] usb 3-6: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2054.705020] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: output gpio0 gpio=0 irq=0 
[ 2054.705026] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: output gpio1 gpio=1 irq=1 
[ 2054.705030] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: output gpio2 gpio=2 irq=2 
[ 2054.705035] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: output gpio3 gpio=3 irq=3 
[ 2054.705040] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: input  gpio4 gpio=4 irq=4 (hwirq)
[ 2054.705059] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: input  gpio5 gpio=5 irq=5 
[ 2054.705064] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: input  gpio6 gpio=6 irq=6 
[ 2054.705068] i2c-ch341-usb 3-6:1.0: ch341_cfg_probe: input  gpio7 gpio=7 irq=7 
[ 2054.705369] i2c-ch341-usb 3-6:1.0: ch341_i2c_probe: created i2c device /dev/i2c-9
[ 2054.705374] i2c-ch341-usb 3-6:1.0: ch341_i2c_set_speed: Change i2c bus speed to 100 kbps
[ 2054.708782] i2c-ch341-usb 3-6:1.0: ch341_usb_probe: connected
Code:
Bus 002 Device 003: ID 8087:07da Intel Corp. 
Bus 002 Device 002: ID 8087:8000 Intel Corp. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0c45:649d Microdia 
Bus 001 Device 002: ID 8087:8008 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 012: ID 1a86:5512 QinHeng Electronics CH341 in EPP/MEM/I2C mode, EPP/I2C adapter
Bus 003 Device 002: ID 279e:024e  
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
dev@dell:~/Desktop/i2c-ch341-usb$ ls /sys/class/gpio
export  gpio1  gpio3  gpio5  gpio7        unexport
gpio0   gpio2  gpio4  gpio6  gpiochip504

Cheers!
  Reply With Quote
Old 2nd December 2018, 06:01 PM   #14
CharlieLaub is offline CharlieLaub  United States
diyAudio Member
 
Join Date: Mar 2007
Location: Michigan
@boomerang:

Can you post a closeup pic of the solder bridge you had to create, or circle these on a pic of the board?

Can you provide a link to where the boards can be purchased? Ebay? These might be easier to obtain than the boards from Electrodragon.

Glad to see you got it working!
__________________
Visit my Audio Web Page <<--CLICK TO LEARN MORE-->> Get my LADSPA plugins

Last edited by CharlieLaub; 2nd December 2018 at 06:03 PM.
  Reply With Quote
Old 2nd December 2018, 10:39 PM   #15
booomerang is offline booomerang  United States
diyAudio Member
 
Join Date: Jan 2013
So as you can see ACT+GND enables gpio+i2c functionality, while GND+TEN enables uart functionality. VCC pad selects 5V or 3.3V which will feed the ch341a chip. The V3 pad can be left out unsoldered.

These boards can be obtained from ebay around $4 shipping included.

Click the image to open in full size.
  Reply With Quote
Old 25th August 2019, 08:03 AM   #16
DRONE7 is offline DRONE7  New Zealand
diyAudio Member
 
Join Date: Aug 2008
reviving this thread to enquire if anyone has used this board for usb audio to gpio i2s....?
Ryanteck RTk.GPIO (PC GPIO Interface) – Pi Supply

Claimed to work cross platform....Win, Mac and Linux
  Reply With Quote
Old 25th August 2019, 09:34 AM   #17
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by DRONE7 View Post
It is a regular STM32 + CH340 programmed in arduino with RPi connector pinout (i.e. compatible with hats). I do not think a usable audio I2S is possible by bit banging, you need a hardware solution for decent jitter. Also it uses a "proprietary" python library, I would not count on long-term maintenance of this kickstarter product.

16MHz Arduino + CH340 + firmata for low speed, Blue pill (STM32 at 72MHz) + firmata for higher speed (e.g. Firmata example * stm32duino/wiki Wiki * GitHub ), all easily programmed in Arduino IDE with firmware directly in the IDE. Standard protocol, libraries for any programming language available, single dollars cost shipped from China.
  Reply With Quote

Reply


Adding GPIO functionality to a Linux desktop computerHide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop computer speaker idea...cheap makingmoney Multi-Way 7 16th August 2012 04:31 AM
2.1 Computer/Desktop Speaker Design pirate121 Multi-Way 7 30th October 2010 03:15 AM
CMOY : built into desktop computer. jcouture Chip Amps 2 27th October 2010 06:02 PM
Desktop OB computer speakers merajsalek Multi-Way 64 8th April 2009 02:16 AM


New To Site? Need Help?

All times are GMT. The time now is 05:02 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 15.00%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
Copyright ©1999-2019 diyAudio
Wiki