jeffdi
make change_power VOLTAGE=<v>
from the gpio_test directory. this will change power without resetting the processor so can be modified after configuring IO. you will need to pull and run make F746ZG-copy
from the nucleo directory before using.Matthew Guthaus
02/17/2023, 5:50 PM# Note:
# Potentiometer is MCP4661 and has 10k ohms in
# 257 steps = 38.9 ohms/step.
# LDO is MIC2211, which has an output equal to
# R1 = R2 * (Vout / 1.25 - 1)
# Where R1 is between Vout and Adj and
# R2 is between Adj and ground.
# The caravel board has R1 = 360 and
# R2 = 5k // (500 + potentiometer value)
R2 = 360 / ((self.voltage / 1.25) - 1)
Rpot = (1 / (1 / R2 - 1 / 5000)) - 500
P = Rpot / 38.911
Pval = int(P)
# print('Writing ' + str(Pval) + ' to potentiometer.')
self.supply.write_1v8(Pval)
def write_1v8(self, value):
self.i2c.write_byte(0x50, start=True, stop=False)
self.i2c.write_byte(0x10 & value >> 8, start=False, stop=False)
ack = self.i2c.write_byte(value & 0xFF, start=False, stop=True)
return ack