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

Get MCP2003B to work with 3.3V ESP8266? #5

Open
t0ny-peng opened this issue Jan 10, 2020 · 5 comments
Open

Get MCP2003B to work with 3.3V ESP8266? #5

t0ny-peng opened this issue Jan 10, 2020 · 5 comments

Comments

@t0ny-peng
Copy link

t0ny-peng commented Jan 10, 2020

@trainman419 You did a very good job! I was using two relay to simulate the button but that's just an ugly solution. It's way better to communicate to the LIN bus directly.

Btw, I'm using ESP8266 in my project. The only problem is that it's output pin has a voltage of 3.3V instead of 5V on an Arduino. I checked the datasheet of MCP2003B and found these about the TDX and RDX:

RDX: It has to be at a high level (> 2.5V typical) while LBUS is recessive

Looks like 3.3V from ESP8266 pin is just fine.

TDX: has an internal pull-up

I don't know if the voltage here will be 5V or 12V, but both are higher than the max tolerant voltage of ESP8266 pin.

Do you have any thought about this problem? I mean I can use a MOSFET as a gate but that seems to be an overkill.

Thanks!

@zoltanhosszu
Copy link

@left4taco were you able to solve this? I'm in the exact same situation with a NodeMCU

@nschurando
Copy link
Contributor

Interested as well.

@trainman419
Copy link
Owner

I have an MCP2003B hooked up to a Sparkfun Thing Dev (ESP8266) and I have not had trouble with it.

I seem to remember finding something about this in the MCP2003B data sheet, but I don't remember exactly where.

@satrik
Copy link

satrik commented Feb 22, 2021

@trainman419 I'm also struggling with my esp8266 (Wemos D1 Mini).

To make the debugging easier, I've switched the lin.h to SoftwareSerial and use the USB port (HardwareSerial) to get some console output. I get a proper answer for the current height (enc_a).

12:58:30.436 -> enc_a
12:58:30.436 -> 1503

I'm wondering about the output of node_a[2] and node_b[2] between the 2 switch(state) in the loop. Neither a button is pressed or not, it shows always:

12:58:30.647 -> node_a[2]
12:58:30.647 -> 37
12:58:30.647 -> node_b[2]
12:58:30.647 -> 37

Do you have any idea what the 37 means and what I could check/test next?

Btw. I've the bigger size bekant and according to the megadesk repo, I've changed this line if (node_a[2] == 0x00 && node_b[2] == 0x00). I've also tried it with 0x60, but it does not change anything so far.

@satrik
Copy link

satrik commented Feb 22, 2021

while reading my own answer, I think I should try if (node_a[2] == 0x25 && node_b[2] == 0x25) 🤔
maybe my table reports it's idle as 37 and not as 96 or 0.

EDIT:
IT WORKS WITH 0x25 (37) 🥳

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

5 participants