bekant
bekant copied to clipboard
Get MCP2003B to work with 3.3V ESP8266?
@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!
@left4taco were you able to solve this? I'm in the exact same situation with a NodeMCU
Interested as well.
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.
@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.
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) 🥳