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

Input pins are set to output type, buggy and/or dangerous if using inputs #23

Open
tranzistoren opened this issue Dec 30, 2016 · 1 comment

Comments

@tranzistoren
Copy link

tranzistoren commented Dec 30, 2016

In mpsse.c, lines 274-275:

		/* Clock, data out, chip select pins are outputs; all others are inputs. */
		mpsse->tris = DEFAULT_TRIS;

in mpsse.h, line 114:

'#define DEFAULT_TRIS            (SK | DO | CS | GPIO0 | GPIO1 | GPIO2 | GPIO3)  /* SK/DO/CS and GPIOs are outputs, DI is an input */

Pins that should be set as inputs are set as outputs.
Quick fix:

#define DEFAULT_TRIS            (SK | DO | CS)  /* SK/DO/CS are outputs, others are inputs */
@dukelec
Copy link

dukelec commented May 28, 2017

Set all gpio default as input, and allow set direction for low port later:
https://github.com/dukelec/libmpsse

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