Issue Accessing Analog GPIOs on UNIC-CASS Chip (Ca...
# caravel-board
f
Issue Accessing Analog GPIOs on UNIC-CASS Chip (Caravan – Nov 2023 Fabrication) Dear all, @Tim Edwards We are experiencing difficulties in testing our analog design fabricated through the UNIC-CASS program in November 2023 using the Analog Caravel (Caravan). Our project is fully analog and relies on the GPIO pads in analog mode, but so far we have not been able to establish proper communication with the user area. Here is what we have tried so far: 1. We tested the following firmwares from the Caravel GitHub repository, such as: chipignite mpw2-5 2. Using the chipignite firmware, we were able to control the pull-up and pull-down resistors, using the MGMT variables. We are also able to correctly load and execute the Blink example (/chipignite/blink). However, we had no success when trying to control the USER variables that connect our project. 3. Our design makes exclusive use of the GPIOs in analog mode. We have attempted to configure them with the appropriate firmware settings (e.g.,
GPIO_MODE_USER_STD_ANALOG
) but have not been able to communicate with our project in the USER area yet. We would greatly appreciate any guidance or suggestions on what we might be missing, especially regarding the correct configuration of the GPIOs for analog operation or any known issues with the Caravan firmware. Thank you in advance for your help! Best regards, Fabián Olivera
t
It sounds like the right configuration, but feel free to share any configuration files or firmware programs if you want confirmation. It would be helpful to know what sort of minimal test you would need to do to confirm that your user project is showing signs of life.
f
Hi Tim, thank you very much for your quick reply. I’ll prepare a detailed explanation of our minimal circuit to be tested, along with the firmware code, as soon as possible.
Dear @Tim Edwards (and @Mitch Bailey, who also kindly replied to me on another channel), Attached, you will find our “.c” code along with a simplified schematic of two circuits from our design. The code was compiled using the chipignite’s defs.h. To verify whether the user project is showing signs of activity, we propose connecting a 10-MΩ resistor between LDO_VDD (reg_mprj_io_30, 1.8 V) and LDO_IREF (reg_mprj_io_31). According to our simulations, since LDO_IREF is the input of an n-MOS current mirror, this node should settle at approximately 0.3 V. In our test, however, the LDO_IREF node is measuring approximately 1.5 V, which is unexpected given the low impedance of the current mirror and seems almost impossible under normal conditions. Thank you very much for your help!
Copy code
#include <defs.h>
void main()
{   
    //reg_spimaster_config = 0xa002;
    reg_mprj_datal = 0x00000000;
    reg_mprj_datah = 0x00000000;
	
	// Ring oscillator circuit
	// Ring_VDD  = reg_mprj_io_9
	// Ring_OUT  = reg_mprj_io_10
    reg_mprj_io_9  = GPIO_MODE_MGMT_STD_ANALOG;
    reg_mprj_io_10 = GPIO_MODE_MGMT_STD_ANALOG;
	
	// LDO regulator circuit
	// LDO_VDD  = reg_mprj_io_30
	// LDO_IREF = reg_mprj_io_31
	// LDO_VB   = reg_mprj_io_32
	// LDO_VS   = reg_mprj_io_33
	// LDO_OUT  = reg_mprj_io_34
    reg_mprj_io_30 = GPIO_MODE_USER_STD_ANALOG;
    reg_mprj_io_31 = GPIO_MODE_USER_STD_ANALOG;
    reg_mprj_io_32 = GPIO_MODE_USER_STD_ANALOG;
    reg_mprj_io_33 = GPIO_MODE_USER_STD_ANALOG;
    reg_mprj_io_34 = GPIO_MODE_USER_STD_ANALOG;
	
    // pulldown from 0 to 8
    reg_mprj_io_0  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_1  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_2  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_3  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_4  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_5  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_6  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_7  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_8  = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
	
	// pulldown from 11 to 29
    reg_mprj_io_11 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_12 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_13 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_14 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_15 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_16 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_17 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_18 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_19 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_20 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_21 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_22 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_23 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_24 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_25 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_26 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_27 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_28 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_29 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
	
	// pulldown from 35 to 37
	reg_mprj_io_35 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_36 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
    reg_mprj_io_37 = GPIO_MODE_MGMT_STD_INPUT_PULLDOWN;
	
    // Apply configuration
    reg_mprj_xfer = 1;
    while (reg_mprj_xfer == 1);
	
    // Idle forever
    while (1);
}