mohamed123
Newbie level 4
Hello everyone,
I'm trying to make a digital potentiometer using mcp4131 and wemos d1 mini dev board in order to use it in studying the IV characteristics of a solar cell remotely. The mcp4131 digipot uses SPI communication. I have used a simple Arduino code for testing. the code works correctly with my Arduino Uno, but when i tried it with wemos d1 mini dev board it doesn't work!
code used with arduino :
that's the error message that appears on the serial monitor:
ets Jan 8 2013,rst cause:2, boot mode3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
I'm trying to make a digital potentiometer using mcp4131 and wemos d1 mini dev board in order to use it in studying the IV characteristics of a solar cell remotely. The mcp4131 digipot uses SPI communication. I have used a simple Arduino code for testing. the code works correctly with my Arduino Uno, but when i tried it with wemos d1 mini dev board it doesn't work!
code used with arduino :
Code C++ - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 #include <SPI.h> byte address = 0x00; int CS= 10; void setup() { pinMode (CS, OUTPUT); SPI.begin(); digitalPotWrite(100) } void loop() { } int digitalPotWrite(int value) { digitalWrite(CS, LOW); SPI.transfer(address); SPI.transfer(value); digitalWrite(CS, HIGH); } [B]code used with wemos:[/B] #include <SPI.h> byte address = 0x00; int CS= D8; void setup() { pinMode (CS, OUTPUT); SPI.beginTransaction(SPISettings(5000000, MSBFIRST, SPI_MODE0)); digitalPotWrite(100); } void loop() { } int digitalPotWrite(int value) { digitalWrite(CS, LOW); SPI.transfer(address); SPI.transfer(value); digitalWrite(CS, HIGH); SPI.endTransaction(); }
that's the error message that appears on the serial monitor:
ets Jan 8 2013,rst cause:2, boot mode3,6)
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09f0c112
~ld
Last edited by a moderator: