Is it correctly understood that if I configure a G...
# mpw-3-silicon
c
Is it correctly understood that if I configure a GPIO to be a output from the management area that the signal will always propagate into the user area? Or are there any caveats for MP3 or in general?
t
Not quite; the signal still has to go all the way to the pad and from the pad back through the digital input buffer. So the GPIO input buffer needs to be turned on or else the input to the user area will be floating. Otherwise, yes, the configuration is designed so that the management SoC can provide pin inputs to the user area. That means that you need to set management bidirectional mode, not management output mode. But it's a bit more complicated than that; on the housekeeping side (for caravel versions prior to MPW-8), the input buffer disable bit of the configuration is used to determine if the housekeeping module should drive the data line to the GPIO. If the input disable bit is zero, the housekeeping will not try to drive that line but will just listen on it. The trick is to this in sequence: (1) set the GPIO configuration to management-controlled bidirectional mode, (2) program the GPIO with the configuration (toggle the transfer bit), then (3) set the GPIO configuration to management-controlled output (without programming the GPIO). Then the GPIO has both input and output drivers turned on, but the management SoC understands that it is in control of the data line, and you can then drive the input to the user project from the management SoC.
c
Thanks for your detailed reply this is really helpful👍
Ok so far so good. Here is a minimum example of me trying to toggle IO_31 with the described procedure. I can measure the output of the pin on the outside. This was also possible before, but hopefully now the signal is also propagating into the user area. @Tim Edwards can you please confirm the procedure is correct so far. Now for "gpio_config_io.py" what am I supposed to set for IO_31 in this case? At the moment it is configured as "C_MGMT_OUT".
Copy code
#include "../defs.h"
#include "../gpio_config/gpio_config_io.c"

void main() {

    reg_mprj_io_31 = GPIO_MODE_MGMT_STD_BIDIRECTIONAL;
    gpio_config_io();
    reg_mprj_io_31 = GPIO_MODE_MGMT_STD_OUTPUT;

    int i;

    while (true) 
    {
        for (i=0;i<=10;i++) 
        {
            reg_mprj_datal = (reg_mprj_datal | 0x80000000);
            delay(10000);
            reg_mprj_datal = (reg_mprj_datal & ~0x80000000);
            delay(10000);
        }
        delay(1000000);
    }
}
t
@Christoph Weiser:
C_MGMT_OUT
will work. Because disabling the input requires an isolated "1" bit, it's impossible to get a working configuration past an independent hold violation, so the
C_MGMT_OUT
has been redefined as bidirectional (both output and input buffers on). In this case, it's exactly what you want.