Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ItsyBitsy M0 Express & AD5254 Digital POT

Status
Not open for further replies.

Freehawk

Full Member level 2
Joined
Jan 10, 2016
Messages
122
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,065
I don't know for sure this is the right place to ask this question :)
I not, lead me into the right direction

I try to make digital pot work with Itsybitsy.
This is the datasheet of the AD5254


I based myself on the following document https://learn.adafruit.com/circuitpython-basics-i2c-and-spi/i2c-devices
I can scan the devices (1 with adres 0x2c) (that seems correct)
But i can't find out how to set pot 1 to a value

AD5254 connections

  • pin 5 (wp) to VCC
  • pin 9 (SDA) to SDA on itsibtsy (with 2.2k pull up resistor to 5v)
  • pin10 to GND,
  • pin 14 (scl) to SCL (with 2.2k pull up resistor to 5v)
  • pin 15 to GND,
  • pin 20 to VCC, (5v)
  • pin 4 (AD0) do D10 itsibisy (this to be able to set AD0=0)
  • pin 16 (AD1) to D11 itsibisy (this to be able to set AD1=0) just to be sure of the slave adress

This is the code i use


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
import busio
import board
from digitalio import DigitalInOut, Direction, Pull
i2c = busio.I2C(board.SCL, board.SDA)
i2c.unlock()
ad1 = DigitalInOut(board.D11)
ad2 = DigitalInOut(board.D10)
ad1.switch_to_output(False)     # Zet AD1 op 0
ad2.switch_to_output(False)     #     AD0
 
while not i2c.try_lock():
    pass
list = [(x) for x in i2c.scan()]
hexlist=[hex(x) for x in list]
 
print('device-list : ', list, hexlist)
 
buf = bytearray(2)
 
i2c.readfrom_into(list[0], buf)
print(buf)
i2c.writeto(list[0], b'0x0', stop=False)
i2c.readfrom_into(list[0], buf)
print('1 :', buf)
i2c.writeto(list[0], b'0x10', stop=True)
i2c.unlock()



I get this result in serial window

device-list : [44] ['0x2c']
bytearray(b'\xff\xff')
1 : bytearray(b'\xff\xff')

Anyone any ideas? Please help me out :)
 

Hi,

pin 4 (AD0) do D10 itsibisy (this to be able to set AD0=0)
pin 16 (AD1) to D11 itsibisy (this to be able to set AD1=0) just to be sure of the slave adress
I recommend to hard wire them to VCC / GND.

****
In the datasheet you find the examples on how to access the digital POT. look at figures 23 down to figure34.
I cant find out from your code, nor do I find it in your description what exactly you want to do and which scheme you use.

I can´t find which POT you want to acces.
I can´t find what value you want to send.
--> Please explain.

Klaus
 

Hi,

I just want to set all pots to a certain value.

Starting with pot 1

I know there are examples in the datasheet
But i don't seem to get them work
 

Hi,

I know there are examples in the datasheet
But i don't seem to get them work
Show how you tried it.

Klaus
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top