User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 12, 2018 5:26 am

tlfong01 wrote:
Wed Dec 12, 2018 5:00 am
Ridiculously Tiny Washing Machine Top Electronics Bench Assembly Notes - Part 1

Fish Tank Assembly Notes

/ to continue, ...
...
Attachments
fish_tank_2018dec1202.jpg
fish_tank_2018dec1202.jpg (185.15 KiB) Viewed 2876 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 12, 2018 5:31 am

SPI Testing Notes

Now I am using my new scope to display the waveforms of the SPI Clock and Mosi signals of repeatedly sending single characters at 100KHz. So far so good. For now I am only checking out the 3V3 level signals. Next step is checking the level shifted up 5V0 signals.
...
Attachments
spi_test_2018dec1401.jpg
spi_test_2018dec1401.jpg (219.38 KiB) Viewed 2842 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Fri Dec 14, 2018 8:49 am

tlfong01 wrote:
Wed Dec 12, 2018 5:31 am
SPI Testing Notes
Now I am using my new scope to display the waveforms of the SPI Clock and Mosi signals of repeatedly sending single characters at 100KHz. So far so good. For now I am only checking out the 3V3 level signals. Next step is checking the level shifted up 5V0 signals.

SPI TXS0104 Level Shifting from 3V3 to 5V0 looks OK
...
Attachments
spi_lovl_shift_2018dec1401.jpg
spi_lovl_shift_2018dec1401.jpg (160.59 KiB) Viewed 2840 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 19, 2018 8:40 am

tlfong01 wrote:
Fri Dec 14, 2018 8:49 am
tlfong01 wrote:
Wed Dec 12, 2018 5:31 am
SPI Testing Notes
Now I am using my new scope to display the waveforms of the SPI Clock and Mosi signals of repeatedly sending single characters at 100KHz. So far so good. For now I am only checking out the 3V3 level signals. Next step is checking the level shifted up 5V0 signals.
SPI TXS0104 Level Shifting from 3V3 to 5V0 looks OK
...

SPI Level Shift Update
...

Code: Select all

# *** spi012018dec1901.py 2018dec19hkt1543 ***
#
# Program Function
# ----------------
# The program is used to detect if the SPI port can repeatedly send out single bytes.  This ia the
# very first program to check out if SPI port is working.  The next program will be a SPI loopback
# program to check out if the SPI port and send and receive single characters.

# Program Description
# -------------------
# This program repeats 200,000 times sending a byte 0x55, pausing 0.00005 second after each byte.
# The SPI port frequency is set at 100kHz, therefore each bit time = 1 sec / 100k = 1000k uS / 100k
# = 10uS, and each char of default 8N1 (8 bits + no parity + 1 stop bit = 9 bits) = 10uS x 9 = 90uS
# Pause after sending each byte = 0.00005 sec = 1,000,000uS x 0.0005 = 500 uS
# Oscilloscope should display one 90uS long 9 bit pattern separated by 500uS pauses
#
# Hardware/Software Descritption
# ------------------------------
# Rpi3B+, Raspbian Version 2018 November, python 3.5.3
#
# Debugging Notes
# ---------------

# Import Modules

import spidev
from   time import sleep

# Create and Config SPI Port

spiPort = spidev.SpiDev()
spiPort.open(0,0) 
spiPort.max_speed_hz = 10000 # 100kHz

# TestFunction

def repeatSendByte(spiPort, sendByte, pauseTimeBetweenBytes, repeatCount):

    def spiSendRecvOneByte(spiPort, sendByte):
        sendByteArray = [sendByte]
        recvByteArray = spiPort.xfer2(sendByteArray)    
        return recvByteArray
    
    print('Begin repeatSendByte(),....')
    for i in range(repeatCount):
        spiSendRecvOneByte(spiPort, sendByte)
        sleep(pauseTimeBetweenBytes)
    print('End   repeatSendByte().')
    return

# Initialization

sendByte    = 0x5a
pauseTime   = 0.005
repeatCount = 200000000000

# Main

repeatSendByte(spiPort, sendByte, pauseTime, repeatCount)

# End
...
Attachments
spi_test_2018dec1901.jpg
spi_test_2018dec1901.jpg (162.52 KiB) Viewed 2796 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 19, 2018 12:54 pm

tlfong01 wrote:
Wed Dec 19, 2018 8:40 am

Rpi3B+ SPI 5V0 Mux testing notes

Now I am checking out TSX0104 x 4 based mux level shifter. So far so good.
...
Attachments
spi_mux_test_2018dec1901.jpg
spi_mux_test_2018dec1901.jpg (191.24 KiB) Viewed 2780 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 19, 2018 1:24 pm

tlfong01 wrote:
Wed Dec 19, 2018 12:54 pm

Rpi3B+ 5 Layer Architecture Hardware Refactoring Notes
...
Attachments
rpi_5_layer_2018dec1901.jpg
rpi_5_layer_2018dec1901.jpg (172.92 KiB) Viewed 2776 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 19, 2018 2:12 pm

tlfong01 wrote:
Wed Dec 19, 2018 12:54 pm

Rpi3B+ SPI CS0 Loopback Test Setup Notes
...
Attachments
spi_loopback_2018dec1902.jpg
spi_loopback_2018dec1902.jpg (187.95 KiB) Viewed 2770 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Fri Dec 21, 2018 1:01 pm

tlfong01 wrote:
Wed Dec 19, 2018 2:12 pm

Testing loopback one byte

Now I am connecting MOSI pin to MISO and check if one byte sent out can read back correctly. The function prints out the send and receive byte, so no scope is needed for this test. So far so good.

The test function and the minimal, complete, verifiable program are listed below.

def testLoopBackOneByte(spiPort, spiSpeed, sendByte):

def spiSendRecvOneByte(spiPort, sendByte):
sendByteArray = [sendByte]
recvByteArray = spiPort.xfer2(sendByteArray)
return recvByteArray

spiPort.max_speed_hz = spiSpeed

recvByteArray = spiSendRecvOneByte(spiPort, sendByte)
recvByte = recvByteArray[0]

print('')
print(' sendByte = ', hex(sendByte))
print(' recvByte = ', hex(recvByte))
print('')

return

...

Code: Select all

# *** spi012018dec2103.py 2018dec21hkt2045 ***
#
# Program Function
# ----------------
# This program has the following test functions:
# 1. repeatSendByte() - to detect if the SPI port can repeatedly send out single bytes.  This ia the
# very first program to check out if SPI port is working.  
# 2. loopBackTest() - to test if the SPI port can send and receive bytes.

# Function Description
# ---------------------
# 1. testRepeatSendByte()
# This function repeats 200,000 times sending a byte 0x55, pausing 0.00005 second after each byte.
# The SPI port frequency is set at 100kHz, therefore each bit time = 1 sec / 100k = 1000k uS / 100k
# = 10uS, and each char of default 8N1 (8 bits + no parity + 1 stop bit = 9 bits) = 10uS x 9 = 90uS.
# Pause after sending each byte = 0.00005 sec = 1,000,000uS x 0.0005 = 500 uS
# Oscilloscope should display one 90uS long 9 bit pattern separated by 500uS pauses
#
# 2. testLoopbackOneByte()
# This function tests sending one byte to MSOI and read it back from MISO, with the two pins
# connected together, forming a loopback or echo back.
#
# Hardware/Software Descritption
# ------------------------------
# Rpi3B+, Raspbian Version 2018 November, python 3.5.3

# Import Modules

import spidev
from   time import sleep

# TestFunctions

def testRepeatSendByte(spiPort, spiSpeed, sendByte, pauseTimeBetweenBytes, repeatCount):

    def spiSendRecvOneByte(spiPort, sendByte):
        sendByteArray = [sendByte]
        recvByteArray = spiPort.xfer2(sendByteArray)    
        return recvByteArray
    
    print('Begin repeatSendByte(),....')

    spiPort.max_speed_hz = spiSpeed
    
    for i in range(repeatCount):
        spiSendRecvOneByte(spiPort, sendByte)
        sleep(pauseTimeBetweenBytes)
    print('End   repeatSendByte().')
    return

def testLoopBackOneByte(spiPort, spiSpeed, sendByte):

    def spiSendRecvOneByte(spiPort, sendByte):
        sendByteArray = [sendByte]
        recvByteArray = spiPort.xfer2(sendByteArray)    
        return recvByteArray

    spiPort.max_speed_hz = spiSpeed
    
    recvByteArray     = spiSendRecvOneByte(spiPort, sendByte)
    recvByte          = recvByteArray[0]

    print('')
    print('            sendByte = ', hex(sendByte))
    print('            recvByte = ', hex(recvByte))
    print('')

    return

# Initialization

spiPort00 = spidev.SpiDev()
spiPort00.open(0,0)

spiPort     = spiPort00
spiSpeed    = 10000
sendByte    = 0x5b

pauseTime   = 0.005
repeatCount = 200000000000

# Main

# testRepeatSendByte(spiPort, spiSpeed, sendByte, pauseTime, repeatCount)

testLoopBackOneByte(spiPort, spiSpeed, sendByte)
    
# End
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Fri Dec 21, 2018 1:52 pm

tlfong01 wrote:
Fri Dec 21, 2018 1:01 pm

SPI Loopback two and three bytes

Now I have completed the loopback two and three bytes, with the following sample output.

# Sample output 2018dec21hkt2141
'''
Begin testLoopbackOneByte(),....
sendByte = 0x5b
recvByte = 0x5b
End testLoopbackOneByte(),....

Begin testLoopbackTwoBytes(),....
sendBytes = 0x55 0x77
recvBytes = 0x55 0x77
End testLoopbackTwoBytes(),....

Begin testLoopbackThreeBytes(),....
sendBytes = 0x55 0x77 0x88
recvBytes = 0x55 0x77 0x88
End testLoopbackThreeBytes(),....
'''


Next step is testing MCP23S17

...

Code: Select all

# *** spi012018dec2105.py 2018dec21hkt2142 ***
#
# Program Function
# ----------------
# This program has the following test functions:
# 1. repeatSendByte() - to detect if the SPI port can repeatedly send out single bytes.  This ia the
# very first program to check out if SPI port is working.  
# 2. loopBackTest() - to test if the SPI port can send and receive bytes.

# Function Description
# ---------------------
# 1. testRepeatSendByte()
# This function repeats 200,000 times sending a byte 0x55, pausing 0.00005 second after each byte.
# The SPI port frequency is set at 100kHz, therefore each bit time = 1 sec / 100k = 1000k uS / 100k
# = 10uS, and each char of default 8N1 (8 bits + no parity + 1 stop bit = 9 bits) = 10uS x 9 = 90uS.
# Pause after sending each byte = 0.00005 sec = 1,000,000uS x 0.0005 = 500 uS
# Oscilloscope should display one 90uS long 9 bit pattern separated by 500uS pauses
#
# 2. testLoopbackOneByte()
# This function tests sending one byte to MSOI and read it back from MISO, with the two pins
# connected together, forming a loopback or echo back.
#
# 3. testLoopbackTwoBytes()
# 4. testLoopbackThreeBytes()
#
# Hardware/Software Descritption
# ------------------------------
# Rpi3B+, Raspbian Version 2018 November, python 3.5.3

# Import Modules

import spidev
from   time import sleep


# Send receive one, two, and three bytes

def spiSendRecvOneByte(spiPort, sendByte):
    sendByteArray = [sendByte]
    recvByteArray = spiPort.xfer2(sendByteArray)    
    return recvByteArray

def spiSendRecvTwoBytes(spiPort, sendByte1, sendByte2):
    sendByteArray = [sendByte1, sendByte2]
    recvByteArray = spiPort.xfer(sendByteArray)
    return recvByteArray

def spiSendRecvThreeBytes(spiPortNum, sendByte1, sendByte2, sendByte3):
    sendByteArray = [sendByte1, sendByte2, sendByte3]
    recvByteArray = spiPort.xfer(sendByteArray)
    return recvByteArray

# TestFunctions

def testRepeatSendByte(spiPort, spiSpeed, sendByte, pauseTimeBetweenBytes, repeatCount):

    def spiSendRecvOneByte(spiPort, sendByte):
        sendByteArray = [sendByte]
        recvByteArray = spiPort.xfer2(sendByteArray)    
        return recvByteArray
    
    print('Begin repeatSendByte(),....')

    spiPort.max_speed_hz = spiSpeed
    
    for i in range(repeatCount):
        spiSendRecvOneByte(spiPort, sendByte)
        sleep(pauseTimeBetweenBytes)
    print('End   repeatSendByte().')
    return

def testLoopBackOneByte(spiPort, spiSpeed, sendByte):

    def spiSendRecvOneByte(spiPort, sendByte):
        sendByteArray = [sendByte]
        recvByteArray = spiPort.xfer2(sendByteArray)    
        return recvByteArray

    spiPort.max_speed_hz = spiSpeed 
    recvByteArray     = spiSendRecvOneByte(spiPort, sendByte)
    recvByte          = recvByteArray[0]

    print('\nBegin testLoopbackOneByte(),....')
    #print('')
    print('      sendByte  = ', hex(sendByte))
    print('      recvByte  = ', hex(recvByte))
    #print('')
    print('End   testLoopbackOneByte(),....')
    return

def testLoopBackTwoBytes(spiPort, spiSpeed, sendByte1, sendByte2):

    spiPort.max_speed_hz = spiSpeed    
    recvByteArray     = spiSendRecvTwoBytes(spiPort, sendByte1, sendByte2)

    print('\nBegin testLoopbackTwoBytes(),....')
    print('      sendBytes = ', hex(sendByte1), hex(sendByte2))
    print('      recvBytes = ', hex(recvByteArray[0]), hex(recvByteArray[1]))
    print('End   testLoopbackTwoBytes(),....')
    return

def testLoopBackThreeBytes(spiPort, spiSpeed, sendByte1, sendByte2, sendByte3):

    spiPort.max_speed_hz = spiSpeed    
    recvByteArray     = spiSendRecvThreeBytes(spiPort, sendByte1, sendByte2, sendByte3)

    print('\nBegin testLoopbackThreeBytes(),....')
    print('      sendBytes = ', hex(sendByte1), hex(sendByte2), hex(sendByte3))
    print('      recvBytes = ', hex(recvByteArray[0]), hex(recvByteArray[1]), hex(recvByteArray[2]))
    print('End   testLoopbackThreeBytes(),....')
    return

# Initialization

spiPort00 = spidev.SpiDev()
spiPort00.open(0,0)

spiPort     = spiPort00
spiSpeed    = 10000

pauseTime   = 0.005
repeatCount = 200000000000

sendByte    = 0x5b
sendByte1   = 0x55
sendByte2   = 0x77
sendByte3   = 0x88

# Main

# testRepeatSendByte(spiPort, spiSpeed, sendByte, pauseTime, repeatCount)

testLoopBackOneByte(spiPort, spiSpeed, sendByte)
testLoopBackTwoBytes(spiPort, spiSpeed, sendByte1, sendByte2)
testLoopBackThreeBytes(spiPort, spiSpeed, sendByte1, sendByte2, sendByte3)
    
# End

# Sample output 2018dec21hkt2141
'''
Begin testLoopbackOneByte(),....
      sendByte  =  0x5b
      recvByte  =  0x5b
End   testLoopbackOneByte(),....

Begin testLoopbackTwoBytes(),....
      sendBytes =  0x55 0x77
      recvBytes =  0x55 0x77
End   testLoopbackTwoBytes(),....

Begin testLoopbackThreeBytes(),....
      sendBytes =  0x55 0x77 0x88
      recvBytes =  0x55 0x77 0x88
End   testLoopbackThreeBytes(),....
'''
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Fri Dec 21, 2018 2:25 pm

tlfong01 wrote:
Fri Dec 21, 2018 1:52 pm
Next step is testing MCP23S17

Setting up MCP23S17
...
Attachments
mcp23s17_setup_2018dec2101.jpg
mcp23s17_setup_2018dec2101.jpg (174.33 KiB) Viewed 2713 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Sat Dec 22, 2018 2:51 pm

tlfong01 wrote:
Fri Dec 21, 2018 2:25 pm
Setting up MCP23S17

SPI MCP23017 Device Addressing Notes

...
Attachments
mcp23s17_2018dec2202.jpg
mcp23s17_2018dec2202.jpg (170.36 KiB) Viewed 2678 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Tue Dec 25, 2018 8:02 am

tlfong01 wrote:
Sat Dec 22, 2018 2:51 pm

MCP23S17 reading register IPOLA failure

Now I am repeatedly writing something to IPOLA and reading it back. But I always get the unexpected result of 0x7f. I swapped another MCP23S17 but still no luck.

def testRepeatWriteReadIpolA():

ioConA = 0x0a
ioDirA = 0x00
iPolA = 0x02

enableHardAddr = 0x04
byte0x55 = 0x55
dummyByte = 0x00

repeatCount = 200000000


print(' Repeat write/read reg, ...')
mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = ioConA, writeByte = enableHardAddr)

for i in range(repeatCount):
mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = iPolA, writeByte = byte0x55)
sleep(0.006)
mcp23S17ReadDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = iPolA)
sleep(0.006)
print(hex(recv5yteArray[0]), hex(recvByteArray[1]), hex(recvByteArray[2]))
return


...

Code: Select all

# mcp23s17_2018dec2504.py tlfong01 2018dec25hkt1439 ***
# $ hostnamectl = raspberrypi Raspbian GNU/Linux 9 (stretch) Linux 4.14.34-v7+ arm 
# >>> sys.version = 3.5.3 Jan 19 2017

import datetime
import time
from   time import sleep
import sys
import spidev

spiPort00 = spidev.SpiDev()
spiPort00.open(0,0)
spiPort00.max_speed_hz = 10000

# *** General SPI Device Register Functions ***

# *** Send receive one, two, and three bytes ***

def spiSendRecvOneByte(spiPort, sendByte):
    sendByteArray = [sendByte]
    recvByteArray = spiPort.xfer(sendByteArray)    
    return recvByteArray

def spiSendRecvTwoBytes(spiPort, sendByte1, sendByte2):
    sendByteArray = [sendByte1, sendByte2]
    recvByteArray = spiPort.xfer(sendByteArray)
    return recvByteArray

def spiSendRecvThreeBytes(spiPort, sendByte1, sendByte2, sendByte3):
    sendByteArray = [sendByte1, sendByte2, sendByte3]
    recvByteArray = spiPort.xfer(sendByteArray)
    return recvByteArray

# *** Mcp23s17 register read/write functions ***

def mcp23S17WriteDvRegOneByte(spiPort, dvSubAddr, dvRegAddr, writeByte):
    dvWriteBaseAddr = 0x40
    dvAddr = dvWriteBaseAddr | (dvSubAddr << 1)
    spiSendRecvThreeBytes(spiPort, dvAddr, dvRegAddr, writeByte)
    return

def mcp23S17ReadDvRegOneByte(spiPort, dvSubAddr, dvRegAddr):
    dvReadBaseAddr = 0x41
    dvAddr = dvReadBaseAddr | (dvSubAddr << 1)
    dummyByte = 0x00
    recvByteArray = spiSendRecvThreeBytes(spiPort, dvAddr, dvRegAddr, dummyByte)
    return recvByteArray[2]

# SPI Test Functions

def testRepeatSendByte(spiPort, sendByte, pauseTimeBetweenBytes, repeatCount):
    print('\nBegin repeatSendByte(),....')
    for i in range(repeatCount):
        spiSendRecvOneByte(spiPort, sendByte)
        sleep(pauseTimeBetweenBytes)
    print('End   repeatSendByte().')
    return

def testLoopBackOneByte(spiPort, sendByte):
    recvByteArray     = spiSendRecvOneByte(spiPort, sendByte)
    recvByte          = recvByteArray[0]

    print('\nBegin testLoopbackOneByte(),....')
    #print('')
    print('      sendByte  = ', hex(sendByte))
    print('      recvByte  = ', hex(recvByte))
    #print('')
    print('End   testLoopbackOneByte(),....')
    return

def testLoopBackTwoBytes(spiPort, sendByte1, sendByte2):
    recvByteArray     = spiSendRecvTwoBytes(spiPort, sendByte1, sendByte2)

    print('\nBegin testLoopbackTwoBytes(),....')
    print('      sendBytes = ', hex(sendByte1), hex(sendByte2))
    print('      recvBytes = ', hex(recvByteArray[0]), hex(recvByteArray[1]))
    print('End   testLoopbackTwoBytes(),....')
    return

def testLoopBackThreeBytes(spiPort, sendByte1, sendByte2, sendByte3):
    recvByteArray     = spiSendRecvThreeBytes(spiPort, sendByte1, sendByte2, sendByte3)

    print('\nBegin testLoopbackThreeBytes(),....')
    print('      sendBytes = ', hex(sendByte1), hex(sendByte2), hex(sendByte3))
    print('      recvBytes = ', hex(recvByteArray[0]), hex(recvByteArray[1]), hex(recvByteArray[2]))
    print('End   testLoopbackThreeBytes(),....')
    return

def testRepeatSendByte1():
    sendByte    = 0x5b
    pauseSecond   = 0.0015
    repeatCount = 20000000
    testRepeatSendByte(spiPort00, sendByte, pauseSecond, repeatCount)
    return

def testLoopBackOneByte1():
    spiPort     = spiPort00
    sendByte    = 0x5b
    testLoopBackOneByte(spiPort, sendByte)
    return

def testLoopBackTwoBytes1():
    spiPort     = spiPort00
    sendByte1   = 0x55
    sendByte2   = 0x77
    testLoopBackTwoBytes(spiPort, sendByte1, sendByte2)
    return

def testLoopBackThreeBytes1():
    spiPort     = spiPort00    
    sendByte1   = 0x55
    sendByte2   = 0x77
    sendByte3   = 0x88
    testLoopBackThreeBytes(spiPort, sendByte1, sendByte2, sendByte3)
    return

# *** MCP23S17 Test Functions ***

def testRepeatWriteIoDirA():
    
    ioConA            = 0x0a
    ioDirA            = 0x00
 
    enableHardAddr    = 0x04
    byte0x55          = 0x55
    
    repeatCount       = 200000000
    pauseSeconds      = 0.0015

    print('        Repeat write IoDdirA, ...')

    mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = ioConA, writeByte = enableHardAddr)   

    for i in range(repeatCount):
        mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = ioDirA, writeByte = byte0x55) 
        sleep(pauseSeconds)      
    return

def testRepeatReadIoDirA():

    ioConA            = 0x0a
    ioDirA            = 0x00
    
    enableHardAddr    = 0x04
    byte0x55          = 0x55
    dummyByte         = 0x00
    
    repeatCount       = 200000000
    pauseSeconds      = 0.0015

    print('        Repeat read IoDirA, ...')
    mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = ioConA, writeByte = enableHardAddr)
    
    for i in range(repeatCount):
        mcp23S17ReadDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = ioDirA) 
        sleep(pauseSeconds)      
    print(hex(recvByteArray[0]), hex(recvByteArray[1]), hex(recvByteArray[2]))
    return

def testRepeatWriteReadIpolA():

    ioConA            = 0x0a
    ioDirA            = 0x00
    iPolA             = 0x02
    
    enableHardAddr    = 0x04
    byte0x55          = 0x55
    dummyByte         = 0x00
    
    repeatCount       = 200000000

    print('        Repeat write/read reg, ...')
    mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = ioConA, writeByte = enableHardAddr)
    
    for i in range(repeatCount):
        mcp23S17WriteDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = iPolA, writeByte = byte0x55)
        sleep(0.006)
        mcp23S17ReadDvRegOneByte(spiPort = spiPort00, dvSubAddr = 0b000, dvRegAddr = iPolA) 
        sleep(0.006)    
    print(hex(recv5yteArray[0]), hex(recvByteArray[1]), hex(recvByteArray[2]))
    return
...
Attachments
read_ipola_failure_2018dec2501.jpg
read_ipola_failure_2018dec2501.jpg (168.78 KiB) Viewed 2412 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Tue Dec 25, 2018 8:46 am

tlfong01 wrote:
Tue Dec 25, 2018 8:02 am
MCP23S17 reading register IPOLA failure
Now I am repeatedly writing something to IPOLA and reading it back. But I always get the unexpected result of 0x7f. I swapped another MCP23S17 but still no luck.

Reading MCP23S17 IPOLA failure 2

Debugging Notes

1. Before the repeat writing and reading IPOLA test, I did the SPI loopback one, two, and three bytes tests OK (with MISO and MOSI shorted). So It is unlikely that the SPI MISO pin/wiring has a problem.

2. I also disconnected the Rpi MISO wire to the MCP23S17 MOSI pin, which is now floating. But still there seemed no output signal (expect 0x55, not ox7f). So the problem seems on the MCP23S17 side.

3. I am now using TXS010n modules to shift up 3V3 Rpi SPI signals to 5V0. I once suspected that the level shifting hardware might cause trouble. So I supplies 3V3 as Vcc to MCP23S17, and used Rpi 3V3 SPI signals to MCP23017, but no luck.

4. I also tried another SPI ADC board MCP3208, which I once tested OK. But still no output from MCP3208. So the problem seems on the Rpi side, ... :mrgreen:

5. I will search my junk box to find any other SPI devices to check out.

Indeed a gloomy Xmas holiday. :(

...
Attachments
write_read_ipola_2018dec2502.jpg
write_read_ipola_2018dec2502.jpg (189.41 KiB) Viewed 2395 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Tue Dec 25, 2018 1:34 pm

tlfong01 wrote:
Tue Dec 25, 2018 8:46 am
reading register IPOLA failure
I will search my junk box to find any other SPI devices to check out.

Tidying up messy SPI and MCP23S17 test functions

In the mean time I am tidying up the messy group of spi and mcp23s17 test functions. I have placed the test functions in two layers:

Layer 0 menu options = spi tests, mcp23s17 tests, and mcp23017 tests

spi tests = repeat send byte, 1,2, and 3 bytes loopback, blinkGpioPort

mcp23217 tests = repeat and one time write/read ioDirA and iPolA registers.

mcp23017 tests = to do later.

Instead of starting trying another SPI device, I think I better write another function, blink the mcp23s17 Gpio ports, just to make sure I can at least write to the registers correctly, even though no luck in reading the registers.

...

Code: Select all

functionList0 = [ \
        'MCP23S17 / MCP23017 Test Functions',
        [
            ['1',  ['spiTestFunctions()'       , testFunctions1]],
            ['2',  ['mcp23s17TestFunctions()'  , testFunctions2]],
            ['3',  ['mcp23017TestFunctons()'   , testFunctions3]],
            ['x',  ['Exit'                     , exitMenu]],
        ]
                ]

functionList1 = [ \
        'SPI Test Functions',
        [
            ['1',  ['testRepeatSendOneByte()'  , testRepeatSendOneByte]],
            ['2',  ['testLoopbackOneByte()'    , testLoopbackOneByte]],
            ['3',  ['testLoopbackTwoBytes()'   , testLoopbackTwoBytes]],
            ['4',  ['testLoopbackThreeBytes()' , testLoopbackThreeBytes]],
            ['x',  ['Exit'                     , exitMenu]],
        ]
                ]
    
functionList2 = [ \
        'MCP23S17 Test Functions',
        [
            ['1',  ['testRepeatWriteIoDirA()'      , testRepeatWriteIoDirA]],
            ['2',  ['testRepeatReadIoDirA()'       , testRepeatReadIoDirA]],
            ['3',  ['testRepeatWriteReadIoDirA()'  , testRepeatWriteReadIpolA]],
            ['4',  ['testOnceWriteIoDirA()'        , testOnceWriteIoDirA]],
            ['5',  ['testOnceReadIoDirA()'         , testOnceReadIoDirA]],
            ['6',  ['testBlinkGpioPort()'          , testBlinkGpioPort]],
            ['x',  ['Exit'                         , exitMenu]],
        ]
                ]

I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Tue Dec 25, 2018 2:29 pm

tlfong01 wrote:
Tue Dec 25, 2018 1:34 pm
Tidying up messy SPI and MCP23S17 test functions[/b]
Instead of starting trying another SPI device, I think I better write another function, blink the mcp23s17 Gpio ports, just to make sure I can at least write to the registers correctly, even though no luck in reading the registers.
[/color]

MCP23S17 GPIO Blink LED Function Writing Notes

Now I have wired another MCP23S17 chip on a bread board for easy swap testing.
...
Attachments
mcp23s17_bread_board_2018dec2502.jpg
mcp23s17_bread_board_2018dec2502.jpg (152.07 KiB) Viewed 2322 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 26, 2018 2:57 am

tlfong01 wrote:
Tue Dec 25, 2018 2:29 pm
Instead of starting trying another SPI device, I think I better write another function, blink the mcp23s17 Gpio ports, just to make sure I can at least write to the registers correctly, even though no luck in reading the registers.
MCP23S17 GPIO Blink LED Function Writing Notes
Now I have wired another MCP23S17 chip on a bread board for easy swap testing.
[/color]

SPI 8 bit MCP23S08 Testing Notes

On second thought, perhaps I should first check out the 8-bit MCP23S08, to make sure that I have not mixed up MCP23S17's 8bit/16bit Band0/Band1 names.

MCP23S08 is 8 bit only, therefore no risk of mixing up names.
:)

Trying out GitHub [yet one more time]

In the last couple of years, I tried GitHub again and again, but every time ended up a failure. The main reason is that I found too many strange names there, like commit, fork etc, and I have been too lazy to read the user guide.

Earlier I wanted to find my old [once working] code of MCP23S17 buried in my long abandoned and very messy file directories and of course could not find them.

So I think I should make a 2019 new year resolution to set up again a github! :mrgreen:

My GitHub [2019 New Year Resolution!]
https://github.com/tlfong01/mcp23x17/

AliExpress MCP23S08/008
https://www.aliexpress.com/store/produc ... 27139.html
https://www.aliexpress.com/item/5pcs-lo ... 86eca01c94
...
Attachments
mcp23s08_2018dec2601.jpg
mcp23s08_2018dec2601.jpg (158.01 KiB) Viewed 2185 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Dec 26, 2018 12:28 pm

tlfong01 wrote:
Wed Dec 26, 2018 2:57 am
Now I have wired another MCP23S17 chip on a bread board for easy swap testing.[/i]
On second thought, perhaps I should first check out the 8-bit MCP23S08, to make sure that I have not mixed up MCP23S17's 8bit/16bit Band0/Band1 names.
MCP23S08 is 8 bit only, therefore no risk of mixing up names.
:)
AliExpress MCP23S08/008
https://www.aliexpress.com/store/produc ... 27139.html

MCP23S17 / MCP23S08 Pair Programming Notes

Now I am testing S17 and S08 together, in sort of pair programming mode, for easy swap troubleshooting and cross checking.
...
Attachments
mcp23s08_2018dec2602.jpg
mcp23s08_2018dec2602.jpg (196.72 KiB) Viewed 2111 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Thu Dec 27, 2018 12:43 pm

tlfong01 wrote:
Wed Dec 26, 2018 12:28 pm
MCP23S17 / MCP23S08 Pair Programming Notes
Now I am testing S17 and S08 together, in sort of pair programming mode, for easy swap troubleshooting and cross checking.
...

MCP23S08 on Bread Board
...
Attachments
mcp23s08_bread_board_2018dec2702.jpg
mcp23s08_bread_board_2018dec2702.jpg (149.16 KiB) Viewed 2001 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Thu Dec 27, 2018 2:39 pm

tlfong01 wrote:
Thu Dec 27, 2018 12:43 pm
tlfong01 wrote:
Wed Dec 26, 2018 12:28 pm
MCP23S17 / MCP23S08 Pair Programming Notes
Now I am testing S17 and S08 together, in sort of pair programming mode, for easy swap troubleshooting and cross checking.
...
MCP23S08 on Bread Board
...

MCP23S08 Test Results

So I tried the same thing, writing and reading IPOLA of MCP23S08. Disappointedly, again the program can only read back 0x7f.

It is very unlikely that both MCP23S17 and MCP23S08 are bad.

The only conclusion is that my program is bad!


Anyway, I have uploaded my bad program to my github. I have no experience uploading a program. I am not sure I can download it OK. Perhaps I can check out tomorrow.


Mcp23s08 Test Program (uploaded to my github!)
https://github.com/tlfong01/mcp23x17/bl ... dec2702.py
...
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Fri Dec 28, 2018 7:04 am

tlfong01 wrote:
Thu Dec 27, 2018 2:39 pm
The only conclusion is that my [MCP23S17/MCP23S08] program is bad!

Using SPI signals to directly control HX711

Let me walked through my failures so far (2018nov24 to now).

1. HX711 requires 25, 26, or 27 pulses as input. The specified clock high time is 0.2uS < t-high < 50uS, low time t-low > 0.2uS. This means a frequency range of 5 MHz highest to 20kHz lowest.

So I decided to use ESP8266-12 to generate 26 pulses of 10 kHz 100kHz as the test input signal.

2. I used NodeMCU Lua to write a toggle program, and found it good to blink a LED at 10Hz. I then tried to blink faster to 50kHz, but disappointedly found that the highest frequency is 500Hz!

3. So I gave up and tried I2C MCP23017 instead. But I found Rpi I2C speed is fixed at 100kHz, which means the narrowest pulse MCP23017 can generate is 200uS or 5kHz!

4. So I gave up I2C MCP23017 and tried SPI MCP23S17. I found Rpi SPI has no problem working at 100kHz. However, I found that I could only read but could not write to MCP23S17. I tried MCP23S08 and found the same problem. This is weird because I did not have this only write but no read on I2C MCP23017. So I concluded that my program has a bug somewhere.

5. Instead of debugging my program, I decided to cheat - use SPI signal directly and forget about ESP8266/MCP230xx/MCP23Sxx altogether!

I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Fri Dec 28, 2018 7:07 am

tlfong01 wrote:
Fri Dec 28, 2018 7:04 am
Using SPI signals to directly control HX711
Instead of debugging my program, I decided to cheat - use SPI signal directly and forget about ESP8266/MCP230xx/MCP23Sxx altogether!

Programming Notes on HX711 control by 26 SPI pulses at 100kHz

/ to continue, ...
...
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Sat Dec 29, 2018 8:37 am

tlfong01 wrote:
Thu Dec 27, 2018 2:39 pm
The only conclusion is that my program is bad!

New Year Resolution 2019 - Write Good Programs! :mrgreen:

So l spent past six hobbyist months writing MCP23Xyz programs to control sensors of temperature, humidity, pressure etc. I mainly used NodeMCU ESP8266-12 Lua and Raspbian Rpi3B+ Python.

The results is very disappointing: all my programs ended up in failure!.

I think one of the main reasons is that I am not serious at all, just coding for fun, without any sense of discipline (Alan Turing 1945). I did successfully wrote a couple of small, working functions, but when the programs get large, it became an unmanageable mess. So I gave up, and started all over again.

My 2019 Year Resolution is to write good engineering programs. So I started googling good references and tutorials, including the following:

The Future of Programming - Uncle Bob 2016may18 624,576 views
https://www.youtube.com/watch?v=ecIWPzGEbFc

How to Write a Really Object Oriented Program, Marcell Lipp, CodeProject, 2018dec27
https://www.codeproject.com/Articles/12 ... ed-Program

Developers Are Coding for the Love of It (Plus the Money) - Nick Kolakowski 2018dec27
https://insights.dice.com/2018/12/27/de ... ove-money/


After reading the above, I know more of my weakness and mistakes in programming. I made a summary below, to remind myself. I also need to watch again Uncle Bob's very educational video at the end of 2019, so to update my 2020 new year resolution ... :mrgreen:

...

Code: Select all

The Future of Programming - Uncle Bob 2016may18 624,576 views
https://www.youtube.com/watch?v=ecIWPzGEbFc

How did our industry start, what paths did it take to get to where we are, and 
where is it going. What big problems did programmers encounter in the past? 
How were they solved? And how do those solutions impact our future? 

What mistakes have we made as a profession; and how are we going to correct 
them. In this talk, Uncle Bob describes the history of software, from 
it’s beginnings in 1948 up through the current day; and then beyond. 

By looking at our past trajectory, we try to plot out where our profession 
is headed, and what challenges we’ll face along the way.

Robert C. Martin (Uncle Bob) has been a programmer since 1970. He is the 
Master Craftsman at 8th Light inc, an acclaimed speaker at conferences 
worldwide, and the author of many books including: The Clean Coder, 
Clean Code, Agile Software Development: Principles, Patterns, and Practices, 
and UML for Java Programmers.

When Good Engineers Write Bad Software - Stephen Cass IEEE Spectrum 2018dec27
https://spectrum.ieee.org/geek-life/reviews/when-good-engineers-write-bad-software

Adam Barr: Fifty years ago there was a NATO Software Engineering Conference, 
where the term “software engineering” was first advanced. Everyone decided 
that software engineering is not really engineering and we had to fix that. ...

There’s a difference between small pieces of software and large pieces of
software. Small being what you do in school, working with one or two people 
on some project. Large software is what industry makes, which is worked on 
by multiple people, and most importantly not necessarily by the same people 
over its lifetime.... They’re really very different in what you have to do. 
So people get to industry, and all these things like maintainability, 
readability, securability, manageability—they haven’t learned any of that 
and have to reinvent it.... Companies like IBM had been studying this in 
the ’70s, and had made some progress on turning software into an engineering 
discipline. That essentially all got thrown away. The invasion of people 
[during the personal computer revolution], from Bill Gates on down, 
basically ignored everything that came before them.

In the life of a software developer, my concern is that by the time you get 
out of college you’ve succeeded without having to really learn a body of knowledge the way a lot of other engineering disciplines do. 

So there’s a period of time before you kind of clue in, and that could be avoided. 
(The academic side could teach) knowledge that was more relevant in the industry, 
so you’d be productive sooner when you started.

How to Write a Really Object Oriented Program, Marcell Lipp, CodeProject, 
2018dec27
https://www.codeproject.com/Articles/1272898/%2FArticles%2F1272898%2FHow-to-Write-a-Really-Object-Oriented-Program

Principles of Object Oriented Programming

First of all, let’s see the official definition of OOP. I found a clear 
definition here.

It says:

“Object-oriented programming (OOP) is a software programming model 
constructed around objects. This model compartmentalizes data into 
objects (data fields) and describes object contents and behavior through 
the declaration of classes (methods).

OOP features include the following:

Encapsulation: This makes the program structure easier to manage because 
each object’s implementation and state are hidden behind well-defined 
boundaries.

Polymorphism: This means abstract entities are implemented in multiple ways.

Inheritance: This refers to the hierarchical arrangement of implementation 
fragments.

Object-oriented programming allows for simplified programming. Its benefits 
include reusability, refactoring, extensibility, maintenance and efficiency.”

Let’s stuck first at the features:

Encapsulation: I think this is the most important one. Each of the objects 
has a state which is hidden for other objects. And on the other hand, there 
is an “implementation” for each object. I understand under that the member 
functions of the objects. And the state and the implementation together is
one unit or with OOP terminology one object. So if your object is a rectangle,
it will have a state with elements like width, high, position, colour, 
etc. And it will have an implementation, implemented member functions, 
like: move, resize, paint, etc. And this is one object, not less, not more.

Inheritance: I would mention it before the polymorphism, because otherwise, 
it is difficult to understand it. Inheritance stands for the connection 
between parent/child classes alias base/inherited classes. So for each class, 
you can define so called child classes which can do everything that the 
base class can to (has the same public methods and member variables), but 
it can overdefine the implementation of the methods and it can extend the 
functionality (introduce new member functions and member variables). 
For example, you have a class for animals. Each animal can move itself. 
But how they can move themselves if different for each animal. 

So the different animals will be inherited from the Animal base class 
and will override the implementation of move method. Plus some animals
have some extra skills, like a dog can bark. So you can define a bark 
method for the Dog class.

Polymorphism: This is exactly what I told about the move method of the 
animals. You can have, for example, a collection of animals and you can 
call the move method for each of them and you shouldn’t mind how it is 
implemented for the animal.

That’s the official theory. Let’s go further with some practical theory.


Developers Are Coding for the Love of It (Plus the Money) - Nick Kolakowski 
2018dec27
https://insights.dice.com/2018/12/27/developer-coding-love-money/

According to Stack Overflow’s (extensive and essential) Developer Survey, 
more than 80 percent of developers code as a hobby outside of work. Not 
only that, but those developers with extensive non-programming 
responsibilities, such as parenting or an affinity for the outdoors, 
were “slightly more likely to code as a hobby than other groups.”

In 2017, another survey by Stack Overflow (unrelated to their Developer 
Survey) found that developers tend to engage with different programming 
languages in their hobbyist work than their day-jobs; on weekends, 
they used Haskell, Assembly, and OpenGL, in contrast to workweeks dominated 
by the likes of Sharepoint, Powershell, and other, more enterprise-centric 
platforms.

“If we look for the tags that have increased the most in weekend activity,
we see the game engine Unity3D, as well as a number of tags used for 
building mobile apps,” Stack Overflow noted at the time. “It looks like 
developers are designing more games and apps on the weekends now than 
in previous years.”

It seems unlikely that those trends have wavered much over the past year;
many developers enjoy toying with the newest languages and platforms to 
come onto the market, even ones that have no bearing on their salaried work. 
In any case, for many developers, coding isn’t just a job—it’s a… 
okay, okay, we’ll stop now.
...
Attachments
alan_turing_1945_2018dec2901.jpg
alan_turing_1945_2018dec2901.jpg (138.86 KiB) Viewed 1833 times
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Sat Jan 19, 2019 6:57 am

tlfong01 wrote:
Sat Dec 29, 2018 8:37 am
The only conclusion is that my program is bad!
New Year Resolution 2019 - Write Good Programs!
I think one of the main reasons is that I am not serious at all, just coding for fun, without any sense of discipline (Alan Turing 1945)
My 2019 Year Resolution is to write good engineering programs. So I started googling good references and tutorials, including the following:
The Future of Programming - Uncle Bob 2016may18 624,576 views

https://www.youtube.com/watch?v=ecIWPzGEbFc

Heart of Agile

I have heard the name "Python" long time ago, but I did not know that it means "a big snake". I have never heard of Monty Python. But I think not knowing the above I can still write good python programs.

But that is different for Agile. I also heard Agile long time ago, but I always felt sad because I never had a chance of using the agile tools, because I am only a solo hobbyist programmer.

It is only recently when I watched Uncle Bob's video on programming that I happily realized that you don't need any agile tools to be an agile programmer. As Alan Turing puts it, it is the discipline that counts.

This morning I also read an interesting article by Blomstrom, saying the following:

The Agile manifesto says it clearly: it's all about the people not the process.

Agile is a "Way of Thinking not a Way of Working".



Agile Isn't Out, You Are - Duena Blomstrom, Forbes 2019jan19
29,786 views

https://www.forbes.com/sites/duenabloms ... f3f7e01337

Definition of python - Cambridge Dictionary
​a very large snake that kills animals for food by wrapping itself around them and crushing them

Monty Python - Wikipedia
Monty Python were a British surreal comedy group who created their sketch comedy show Monty Python's Flying Circus, which first aired on the BBC in 1969.

Definition of agile - Merriam-Webster
1 : marked by ready ability to move with quick easy grace an agile dancer
2 : having a quick resourceful and adaptable character an agile mind


Heart Of Gold - Neil Young 79,473,461 views
https://www.youtube.com/watch?v=Eh44QPT1mPE
I am an electronics and smart home hobbyist.

User avatar
tlfong01
Posts: 1312
Joined: Sat Jun 02, 2018 1:43 pm
Location: Hong Kong

Re: Reading old weight scale

Wed Jan 23, 2019 9:13 am

tlfong01 wrote:
Sat Jan 19, 2019 6:57 am

Opening a New Topic for This Thread

When I joined the discussion of this weight scale topic in the very beginning, I did not expect to write so many posts. But then I found the weight sensor HX711 very interesting, so I did some research, and try to test the device, using ESP8266, MCP23017, and then MCP23S17.

I found it hard to test HX711, so even I tried different approaches, and sadly all ended up in failures, because I made too many newbie mistakes. I did learnt a lot from these mistakes, and I think this is after all a problem based learning project, where final results is not important, but learning is.

I found this topic's posts are ridiculously long, so I decided to stop here. Instead, I will open a new topic, and try to limit the number of posts, focusing on a narrow topic.

For example, I am going to open a new topic on

Using MCP23027 to control a solenoid, ...

...

Code: Select all

Summary/Table of Contents of this thread

READING OLD WEIGHT SCALE Postby Neomorph » 2018-Nov-18 Sun 12:03 am
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1393160

HX711 Where to start
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1393745

HX711 Summary
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1393796


Load Cell, Wheatstone Bridge, Strain Measurement, and Testing Notes
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1393813
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1395158
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1395349

HX711 ESP8266 WeMos D1 Mini Setup and Testing
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1394199
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1394216

Digital Scale Tearing Down Notes
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137#p1395288

HX711 Programming Notes
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=25#p1395969

HX711 Using ESP8266 NodeMCU Lua
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=25#p1395969

I2C and MCP23017 Programming for HX711
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=50#p1397916
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1400984
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1401422
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1401804

MCP23017 Programming - Memory Refreshing Old Posts
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1400599

Rpi Stretch Setup Notes
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=50#p1400274
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1400484
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1400488

SPI and MCP23S17 Testing
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1401555
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1401839
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1402397
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1402872
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=100#p1403249


Washing Machine Top Bench Setup
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=75#p1403243

Programming Notes
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=100#p1409335
https://www.raspberrypi.org/forums/viewtopic.php?f=37&t=227137&start=100#p1418611
I am an electronics and smart home hobbyist.

Pasfa
Posts: 5
Joined: Thu May 30, 2019 4:17 am

Re: Reading old weight scale

Sun Jul 28, 2019 12:10 am

tlfong01 wrote:
Fri Nov 23, 2018 8:11 am
tlfong01 wrote:
Fri Nov 23, 2018 7:45 am
1kg Load Cell Test Results
Load / Output

500ml water = -1.9V

500ml water + 110 ml milk = -2.2V



Sensitivity Calculation
...


Hello,
I would like to know the model of the weight scale that you are using.
Would you advice me to use this one ? https://tacunasystems.com/products/scal ... n-balance/
Thank you

Return to “Automation, sensing and robotics”