This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Fastest way to switch GPIO to output mode or disabling Pull-up resistor at start/reset (28035)



Hello,

what is the fastest way to switch a GPIO Pin to output mode or disabling the internal Pull-up resistor on a Piccolo 28035..

When I use the first instruction within the main() to switch the mode it tooks up to 5ms.

When I put following code inside the CodeStartBranch.asm file:

EALLOW

MOVW   DP, #0x1BE

OR         @0xB, #0x0002     ; Set GPIO 17 to output

OR         @0xB, #0x0004     ; Set GPIO 18 to output

EDIS

It tooks only 300µs.

Is there any other way to minimize the time?

The GPIOs are connected to a safety relevant switch witch should not be activated at start-up.

All PWM pins are used for other functions.

Best regards,

André

  • Andre,

    Hello!

    If you do not mind my comments, I would like to say that you are solving the wrong problem.  If you are using Active HIGH logic on a GPIO on this family of processors, then you need to have your external circuit be able to handle the power on glitch that you describe - I do the very same thing on my designs here.

    Another thing to consider... the GPIO pins do not have resistor pullups in the conventional sense.  The pullups are a very limited (80uA and 205uA) current source that attempt to pullup the pin. By attempt, I mean that if the pin can not be pulled to the 3.3V rail in 205uA, then it will go to the highest voltage that it can.

    In your design, use the worst case current (205uA) and size your circuit so that 205uA does not activate the safety switch.

    Sincerely,

    Will

  • Hello Will,

    thanks for your answer!

    You are right! It is not the best way to use active high logic without countermeasures on this processor familiy.

    But unfortunately I have to work with the hardware the hardware section has designed. I am only the software guy who has to solve all issues at the end. (-:

    I think the best way is to do a hardware re-design.

    Regards,

    André