X9C104 not enough steps?

Hello sorry for bad englisch and sorry if already asked but i did not find an answer.
I am trying to control a x9c104 but i cannot get it to have more than about 30 steps (full 100k ohm range)
I dont know if i am misunderstand something but i think it shoud have 100 steps?
I need help on how to fix the range, a clarification or an alernative.

Thanks in advance.

setup:
Resistor 10k pullup from vin for POT-INC
Vcc 5v
Gnd 0v
Pot Rh 4.3v (vin back redcable)
Pot Rl 0v (gnd back blue and front black cable)
Pot Rw probe Blue (A0 back yellow
Front left to right
5v red
Gnd black
White POT_INC pin 2
Brown POT_UD PIN 3
Orange POT_CS pin 4

YELLOW=POT_INC
BLUE=POT OUTPUT (trigger)
Short blue flats are new call of pulseup(10)

My test code:
Code for analog read can be ignored

uint8_t POT_CS = 4;
uint8_t POT_UD = 3;
uint8_t POT_INC = 2;
uint8_t AREAD = A0;
int val = 0;
int val2 = 0;

void setup() {
  Serial.begin(9600);

  pinMode(POT_CS, OUTPUT);
  pinMode(POT_UD, OUTPUT);
  pinMode(POT_INC, OUTPUT);
  pinMode(AREAD, INPUT);
  
  digitalWrite(POT_INC, LOW);
  digitalWrite(POT_UD, LOW);
  digitalWrite(POT_CS, HIGH);
  delay(200);
  
  pulseDown(100);
  val=0;
}

void pulseUp(int count) {
  digitalWrite(POT_CS, LOW);
  digitalWrite(POT_UD, HIGH);
  val+=count;
  while(count>0){
    delay (10);
    digitalWrite(POT_INC, HIGH);
    delay (10);
    digitalWrite(POT_INC, LOW);
    count--;
  }
  digitalWrite(POT_CS, HIGH);
  digitalWrite(POT_UD, LOW);
}

void pulseDown(int count) {
  digitalWrite(POT_CS, LOW);
  digitalWrite(POT_UD, LOW);
  val-=count;
  while(count>0){
    delay (1);
    digitalWrite(POT_INC, HIGH);
    delay (1);
    digitalWrite(POT_INC, LOW);
    count--;
  }
  digitalWrite(POT_CS, HIGH);
  digitalWrite(POT_UD, LOW);
}

void loop() {
  //Serial.println("start");
  delay(100);
  pulseUp(10);
  pulseUp(10);
  pulseUp(10);
  pulseUp(10);
 ;
  
  while (true){
    delay (1000);
  }
  
  
  //pulseDown(100);
  //Serial.println(val);
  //delay (2000);
  //if (val >= 256) val = 0;
  //analogWrite(LEDPIN,val);
  //delay(100);
  //Serial.println(val);
  //val += 1;
}

Greetings playprogramm

I need help on how to fix the range, a clarification or an alernative.

@playprogramm
Your code only increments it 40 times and I see about 36 increments on your scope.

The library did not change the behavior

This is the full 100 pulses produced by tthe library mentiont in the first answer.

The blue line is the full 100k range but only in 30 pulses. The library and I expected 100.
I get the same result with my own test code.

Your test code only increments it 40 times

I know but it should not get the full 100.000 ohms in max 40 steps. It should take 100.

Why do you have this connected to Vin?
It should be connected to 5V

Pot Rh 4.3v (vin back redcable)

This should also be connected to 5V

Nothing should be connected to Vin

Was easier for testing changed it to 5v.

Raised test max voltage from 4.3v to 5v
Behavior is the same

Hope this explaines more

The instability is probbably from not using pull up or pulldown with faster pulsing through library.

It looks like you are doing everything right, it should be 100 steps.

I would have to say that maybe it's a 32 tap part that is marked incorrectly or a counterfeit part.

Ok thanks for the help, going to buy another part then.

Not from the same seller

Yeah, i wrote the seller hoping to get my money back.

Good luck

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.