Dan Fritchman
02/16/2022, 8:01 PMslippage
script is always correctly modifying values for configuring IOs 0-18, and
(b) IOs 19 and up are devoid of similar problems?
We’re having all sorts of trouble configuring a subset of the user-space IOs. Walking through all of them, I see these discrepancies between the firmware-program and bench measurements:
* MPRJ IOs 3 & 4 - set as INPUT, look like an OUTPUT
* MPRJ IOs 12 & 13 - set PULLDOWN, looks like a NOPULL input
* MPRJ IOs 14 & 15 - set OUTPUT, looks like an input
* MPRJ IO 22 - set INPUT NOPULL, looks like a pull-down
* MPRJ IO 24 - set OUTPUT, looks like an input
When I say “looks like”, I mean I hook up a ~1k decade box to the pin, move the other end between VSS and VDD, and observe whether the chip appears to be driving that pin.
Some of these are more damaging than others. Inclusion or exclusion of the pull-up/downs, for example, isn’t a real problem in our context (although it may be indicative of underlying programming problems). But several of these INPUT vs OUTPUT discrepancies (3 & 4, 24) are on our bring-up/ debug interfaces. They’ve gotta work, or our chip’s DOA.
FWIW the code configuring all this is here:
https://github.com/ucberkeley-ee290c/caravel_board/blob/main/firmware/osci/osci.c
And my paired edits to your slippage
script live next to it, here:
https://github.com/ucberkeley-ee290c/caravel_board/blob/main/firmware/osci/slippage.py
Thanks in advance.Tim Edwards
02/16/2022, 8:29 PMTim Edwards
02/16/2022, 9:43 PMDan Fritchman
02/16/2022, 10:08 PMDan Fritchman
02/16/2022, 10:12 PMslippage
script:
From `defs_mpw-two-mfix.h`:
// Useful GPIO mode values
// Important note! GPIOs 1 to 4 have a reversed bit for
// management disable that requires swapping the values
// for "USER" and "MGMT" for these four pins. Normally, use
// of these pins for user project purposes is discouraged, so
// it should not be a major issue.
#define GPIO_MODE_USER_STD_INPUT_NOPULL 0x0403
#define GPIO_MODE_USER_STD_INPUT_PULLDOWN 0x0803
#define GPIO_MODE_USER_STD_INPUT_PULLUP 0x0c03
#define GPIO_MODE_USER_STD_OUTPUT 0x1809
#define GPIO_MODE_USER_STD_BIDIRECTIONAL 0x1803
#define GPIO_MODE_USER_STD_OUT_MONITORED 0x1803
#define GPIO_MODE_USER_STD_ANALOG 0x000b
#define GPIO_MODE_MGMT_STD_INPUT_NOPULL 0x0402
#define GPIO_MODE_MGMT_STD_INPUT_PULLDOWN 0x0802
#define GPIO_MODE_MGMT_STD_INPUT_PULLUP 0x0c02
#define GPIO_MODE_MGMT_STD_OUTPUT 0x1808
#define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 0x1802
#define GPIO_MODE_MGMT_STD_OUT_MONITORED 0x1802
#define GPIO_MODE_MGMT_STD_ANALOG 0x000a
Versus the (similar, not identical) ones in `defs.h`:
// Useful GPIO mode values
#define GPIO_MODE_MGMT_STD_INPUT_NOPULL 0x0403
#define GPIO_MODE_MGMT_STD_INPUT_PULLDOWN 0x0803
#define GPIO_MODE_MGMT_STD_INPUT_PULLUP 0x0c03
#define GPIO_MODE_MGMT_STD_OUTPUT 0x1809
#define GPIO_MODE_MGMT_STD_BIDIRECTIONAL 0x1801
#define GPIO_MODE_MGMT_STD_ANALOG 0x000b
#define GPIO_MODE_USER_STD_INPUT_NOPULL 0x0402
#define GPIO_MODE_USER_STD_INPUT_PULLDOWN 0x0802
#define GPIO_MODE_USER_STD_INPUT_PULLUP 0x0c02
#define GPIO_MODE_USER_STD_OUTPUT 0x1808
#define GPIO_MODE_USER_STD_BIDIRECTIONAL 0x1800
#define GPIO_MODE_USER_STD_OUT_MONITORED 0x1802
#define GPIO_MODE_USER_STD_ANALOG 0x000a
FWIW we have been using the former.Tim Edwards
02/17/2022, 3:10 PMdefs_mpw-two-mfix.h
file corresponds to the specific metal mask fix that we made to the ChipIgnite-1 version of Caravel. The difference is that we inverted the sense of bit 0, which was formerly the "management enable" bit but is now, effectively, the "management disable" bit. However, for reasons of keeping the housekeeping SPI active on power-up, GPIO channels 1, 2, 3, and 4 were not modified. As you can see from the list you quoted, the only difference is that "USER" changes to "MGMT" and vice versa. Just make sure that for GPIO channels 1 through 4, if you use defs_mpw-two-mfix.h
, then you want to use the "MGMT" string for user control. As I said, it's confusing, but was necessary to do.jeffdi
jeffdi
Weston Braun
02/18/2022, 5:45 AMWeston Braun
02/18/2022, 5:50 AMvalue 100 = open drain to power
value 101 = open drain to ground
value 110 = digital output
value 111 = digital output (weak)
But that would not make pins set as outputs be set as inputs.Weston Braun
02/18/2022, 5:52 AMWeston Braun
02/18/2022, 5:53 AMjeffdi
Tim Edwards
02/18/2022, 2:02 PM