Home Electronics A self-testing GPIO – EDN

A self-testing GPIO – EDN

0
A self-testing GPIO – EDN

[ad_1]

Common objective input-output (GPIO) pins are the best peripherals.

The hyperlink to an object beneath management (OUC) might turn into inadvertently unreliable as a consequence of many causes: a lack of contact, quick circuit, temperature stress or a vapor condensate on the elements. Generally a greater hyperlink could be established with the favored bridge chip by merely exploring the probabilities supplied by the chip itself.

Wow the engineering world together with your distinctive design: Design Concepts Submission Information

The bridge, comparable to NXP’s SC18IM700, often supplies a specific amount of GPIOs, that are helpful to implement a take a look at. These GPIOs protect all their performance and can be utilized as typical after the take a look at.

Leveraging Advanced Microcontroller Features to Improve Industrial Fan Performance 

03.21.2024

FerriSSD Offers the Stability and Data Security Required in Medical Equipment 

03.18.2024

Edge Computing’s Quantum Leap: Advantech HPEC Solution Accelerates Edge Evolution

03.18.2024

To make the take a look at attainable, the chip should have multiple GPIO. This manner, they are often paired, bringing the chance for the members of the pair to ballot one another.

For the reason that exercise of the GPIO throughout take a look at might hurt the common features of the OUC, one of many GPIO pins could be chosen to short-term prohibit these features. Fairly often, when this object is kind of inertial, this prohibition could also be omitted.

Determine 1 exhibits how the thought could be applied within the case of the SC18IM700 UART-I2C bridge.

Determine 1: Self-testing GPIO utilizing the SC18IM70pytho0 UART-I2C bridge.

The values of resistors R1…R4 should be giant sufficient to not result in an unacceptably giant present; then again, they need to present ample voltage for the logic “1” on the enter. The values proven on Determine 1 are good for probably the most functions however might must be adjusted.

Some difficulties might come up solely with a quasi-bidirectional output configuration, since on this configuration it’s weakly pushed when the port outputs a logic HIGH. The issue might happen when the resistance of the corresponding OUC enter is simply too low.

If the info charge of the UART output is simply too excessive for a correct charging of the OUC-related capacitance throughout the take a look at, it may be decreased or, the corresponding values of the resistors could be lessened.

The sketch of the Python subroutine follows:

PortConf1=0x02
PortConf2=0x03

def selfTest():
        information=0b10011001
        bridge.writeRegister(PortConf1, information)  #PortConfig1

        information=0b10100101
        bridge.writeRegister(PortConf2, information)  #PortConfig2

#--- write 1
        cc=0b11001100
        bridge.writeGPIO(cc)

        aa=bridge.readGPIO()    # 0b11111111
        if aa != 0b11111111 : return False          # examine

#---- write 0
        cc=0b00000000
        bridge.writeGPIO(cc)

        aa=bridge.readGPIO()
        if aa != 0b00000000 : return False          # examine

# companions swap
        information=0b01100110
        bridge.writeRegister(PortConf1, information)  #PortConfig1

        information=0b01011010
        bridge.writeRegister(PortConf2, information)  #PortConfig2

#---write 1
        cc=0b00110011
        bridge.writeGPIO(cc)

        aa=bridge.readGPIO()
        if aa != 0b11111111 : return False          # examine

#---- write 0
        cc=0b00000000
        bridge.writeGPIO(cc)

        aa=bridge.readGPIO()
        if aa != 0b00000000 : return False          # examine

# examine quasy-bidirect
        information=0b01000100
        bridge.writeRegister(PortConf1, information)  #PortConfig1

        information=0b01010000
        bridge.writeRegister(PortConf2, information)  #PortConfig2

#---write 1
        cc=0b00110011
        bridge.writeGPIO(cc)

        aa=bridge.readGPIO()
        if aa != 0b11111111 : return False          # examine

#---- write 0
        cc=0b00000000
        bridge.writeGPIO(cc)

        aa=bridge.readGPIO()
        if aa != 0b00000000 : return False          # examine
        return True    

Peter Demchenko studied math on the College of Vilnius and has labored in software program growth.

Associated Content material

[ad_2]