DS3502 problem

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

DS3502 problem

Post by rjdadio »

Hello, I am using your DS3502 digital Pot and getting strange output.
First I will describe my setup.
I am using Arduino with a QTPY as the processor and have a up and down two button UP and DN count control program using the JC_Button library. Connected to the processor is a 128 x 32 OLED display and using U8g2lib library.
The display shows the count, and I can move up and down within my 0-127 steps.
I am trying to set the wiper using the ds3502.setWiper() by using a variable "count"... so "ds3502.setWiper(count)." The count is displayed correctly on the OLED and does not change unless the count changes with either button push.
In my test setup I use the serial monitor to see what is going on with a " int value = ds3402.getWiper()"
When I change the count, the value count number momentarily shows at the serial monitor correctly and then goes to a 255 value and the OLED stays at the count number.
First question, Why do I get a 255 when the top number should be 127?
Second, Do I have to save the "count" with ds3502.setWiperDefault(value) to save the value?

Here is snippet of display code...

ds3502.setWiper(count);
int value = ds3502.getWiper();
u8g2.firstPage();
u8g2.setFont(u8g_font_profont22);
u8g2.setCursor(50, 16); // digital number
u8g2.print(count); // count
u8g2.nextPage();

Serial.print(value);
Serial.println(" V");

I had hoped to not have to write the register number to the internal memory every time.
What am I doing wrong? Thanks, Ray

User avatar
rooppoorali
 
Posts: 98
Joined: Sat Jul 16, 2022 12:04 pm

Re: DS3502 problem

Post by rooppoorali »

Hi, which pin of the Arduino is connected to the VCC of the DS3502? 5V or 3.3V?

User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

Re: DS3502 problem

Post by rjdadio »

The VCC is using the 3.3v regulator from the QTPY and the V+ is a separate source that has not been hooked up as of yet because I am still building the circuit. The electronics using the POT will be simple. I chose the DS3502 because of the higher voltage limit of the POT.

User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

Re: DS3502 problem

Post by rjdadio »

I have found that the I2C display is the issue. When I take out, comment out, the display... the POT responds correctly.
Currently trying different OLED libraries and so far not getting others to work either. I really didn't want go with SPI display, because I would run short of IO pins for my application. The higher voltage digital POT is a plus due to less components needed to make the circuit run. To use the lower voltage digital POTs would require an additional OP Amp, Mosfet and other components. Trying to keep component count to a minimum.

User avatar
adafruit_support_carter
 
Posts: 29056
Joined: Tue Nov 29, 2016 2:45 pm

Re: DS3502 problem

Post by adafruit_support_carter »

Sounds like maybe the U8g2lib library is not sharing the I2C bus nicely.

Which specific OLED display are you using?

User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

Re: DS3502 problem

Post by rjdadio »

128x32 OLED display. Using your Adafruit SSD1306 library, the display will not reset after a ds3502.setWiperDefault() call to save the wiper position. At power up the display will be blank until I hit the reset button. Is there a way to send a display reset? I start everything out with a "display.clearDisplay();" as a line in the void setup() after display.begin.

User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

Re: DS3502 problem

Post by rjdadio »

I found the blank display at start up a problem in the past using Adafruit SSD1306 so that is why I started using Oliver's library. I really like Adafruit products and your products have treated me well in the past few years, so if you have a simple solution...I would listen. Thanks!

User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

Re: DS3502 problem

Post by rjdadio »

You asked what OLED I was using. It is a DIY MORE OLED-091.
I went looking at the schematic for the Adafruit OLED Feather Wing and see you use a APX803 reset chip to reset the OLED, so this is why the Feather Wing works, but not a plain jane OLED with your library.

User avatar
rjdadio
 
Posts: 15
Joined: Thu Dec 08, 2016 2:34 am

Re: DS3502 problem

Post by rjdadio »

ok, problem solved. The DIYMORE OLED was the problem. I used another generic OLED and it works.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”