Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4 usable GPIOs? #1

Closed
zoobab opened this issue Jan 3, 2018 · 3 comments
Closed

4 usable GPIOs? #1

zoobab opened this issue Jan 3, 2018 · 3 comments
Assignees

Comments

@zoobab
Copy link

zoobab commented Jan 3, 2018

Hi,

I have tested your driver on my electrodragon board:

https://www.zoobab.com/ch341-usb-spi-i2c-uart-isp-dongle#toc5

I could manage to see 4 gpios in sysfs with the following pinout on the board:

D4 = GPIO4
D2 = GPIO3
D1 = GPIO2
??? = GPIO5

Now, I am trying to use them with urjtag, that needs 4 GPIOs to have a JTAG cable, but it complains GPIO5 cannot be set.

Is there a way to have 4 usable GPIOs, or for now the maximum is 3?

Thanks again for your work.

@gschorcht
Copy link
Owner

Hi,

sorry for the late answer, we had holiday season here.

The default configuration is

struct ch341_pin_config ch341_board_config[CH341_GPIO_NUM_PINS] = 
{
    // pin  GPIO mode           GPIO name   hwirq
    {   15, CH341_PIN_MODE_CS , "cs0"     , 0 }, // used as CS0
    {   16, CH341_PIN_MODE_CS , "cs1"     , 0 }, // used as CS1
    {   17, CH341_PIN_MODE_CS , "cs2"     , 0 }, // used as CS2
    {   19, CH341_PIN_MODE_IN , "gpio4"   , 1 }, // used as input with hardware IRQ
    {   21, CH341_PIN_MODE_IN , "gpio5"   , 0 }  // used as input
};

So, at least in the default configuration pin 21 that corresponds to D6 is called gpio5 and becomes visible in sysfs as an input port. Unfortunatly, this is the only pin that can't be an output.

How does your ch341_board_config looks like?

Regards
Gunar

@zoobab
Copy link
Author

zoobab commented Jan 11, 2018

I could have more usable GPIOs (6 in total) with your other driver i2c-ch341-usb, see here:

https://www.zoobab.com/ch341-usb-spi-i2c-uart-isp-dongle

@gschorcht
Copy link
Owner

More GPIO's could be used with i2c-ch341-usb driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants