hi <@U017X0NM2E7> when we are using the io pins in...
# caravel
s
hi @Mitch Bailey when we are using the io pins in caravel user area, we can find out,in and oenb. in firmware we can define io pins to be input or output so that means either input or output pins will be mux. but if we use io_oenb, how does the logic overright firmware? oenb is userarea logic. I am not sure about io input /output muxing logic in user area, and how is it decoupled from managementment control of these pins
m
@samarth jain I think what you are asking about is how to configure the gpio cells. This is done with the
caravel_user_project/verilog/rtl/user_defines.v
file that you must modify. See the
GPIO Configuration
section here. gpio’s that are configured for output or as bidirectional require the corresponding
io_oenb
to be low when output is enabled. It is probably a good idea to tie unused
io_out
and
io_oenb
signals to power or ground to avoid possible leakage due to unconnected gate input.
s
@Mitch Bailey so if my user area needs a io to be output, I can connect the wire from user area net to Io_out and connect io_oenb to gnd in the gds? other case if I need the io to be input, I can connect the net from userarea to io_in and also connect the io_oenb to vcc of user area ?
m
@samarth jain good questions! There was a bit of confusion on this subject which resulted in the creation of an oeb check program as part of
mpw_precheck
. Here are the 13 predefined gpio configurations
Copy code
GPIO_MODE_MGMT_STD_INPUT_NOPULL
GPIO_MODE_MGMT_STD_INPUT_PULLDOWN
GPIO_MODE_MGMT_STD_INPUT_PULLUP
GPIO_MODE_MGMT_STD_OUTPUT
GPIO_MODE_MGMT_STD_BIDIRECTIONAL
GPIO_MODE_MGMT_STD_ANALOG

GPIO_MODE_USER_STD_INPUT_NOPULL
GPIO_MODE_USER_STD_INPUT_PULLDOWN
GPIO_MODE_USER_STD_INPUT_PULLUP
GPIO_MODE_USER_STD_OUTPUT
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
GPIO_MODE_USER_STD_ANALOG
In order to propagate an external input signal to the user area, the gpio should be programmed as one of the following.
Copy code
GPIO_MODE_MGMT_STD_INPUT_NOPULL
GPIO_MODE_MGMT_STD_INPUT_PULLDOWN
GPIO_MODE_MGMT_STD_INPUT_PULLUP
GPIO_MODE_MGMT_STD_BIDIRECTIONAL

GPIO_MODE_USER_STD_INPUT_NOPULL
GPIO_MODE_USER_STD_INPUT_PULLDOWN
GPIO_MODE_USER_STD_INPUT_PULLUP
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
Note that all
MGMT
input is also input to the user area. For
Copy code
GPIO_MODE_USER_STD_INPUT_PULLDOWN
GPIO_MODE_USER_STD_INPUT_PULLUP
The
USER
must provide the appropriate output on
io_out
(fixed low for pull down and fixed high for pull up) AND set
io_oeb
to low. In order to have the user output actually output from the gpio cell,
io_oeb
should be low and one of the following modes should be used.
Copy code
GPIO_MODE_USER_STD_OUTPUT
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
In these modes,
io_oeb
high will disable the gpio output buffer (Hi-Z output), which will allow external input in the case of
Copy code
GPIO_MODE_USER_STD_BIDIRECTIONAL
GPIO_MODE_USER_STD_OUT_MONITORED
In these 2 modes, when
io_oeb
is low, the user input
io_in
will follow
io_out
. In summary…. For simple input usage, Set the gpio mode to
GPIO_MODE_USER_STD_INPUT_NOPULL
and tie
io_out
and
io_oeb
high or low to Hi-Z avoid leakage. For simple always enabled output usage, Set the gpio mode to
GPIO_MODE_USER_STD_OUTPUT
and tie
io_oeb
low.
👌 1