Eddie

Members
  • Content Count

    15
  • Joined

  • Last visited

About Eddie

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi, I have a microblaze running on an arty a7 dev board. I have a DA4 connected to JC (i've also connected it to JD and got the same behavior.) I'm using the dpg1/da1 ip, they're identical as far as I can tell. In vitis I'm using the xspi driver that came with the da1/dpg1, again identical. I modified the DA1 Demo a bit to get it to work. There is one problem though: outputs A and C don't work. Quickprint2 is an image of my scope with the yellow line showing output A, Quickprint3 is the yellow line showing B. The blue line is the chip select pin and the purple is the data coming over DIN. I've verified that there is nothing coming out of the actual chip on output A with a probe as well. I'm pretty sure it's just broken, like maybe I shorted something? Here's my main.c and DA1 modified driver. I'm just using the DA1 driver to init. Then I just transfer straight to the device. I'm using the Oled rgb as well which is working fine but is commented out below. Why aren't the A & C outputs giving me anything with the same code running as the working B,D,E,F,G,H outputs. I am addressing all DACs. I've also tried it with just addressing the individual DACs, same thing, no output on A. B works fine. Thanks for any help! Ed #include "PmodOLEDrgb.h" #include "../headers/PmodDA1.h" #include "sleep.h" #include "xil_cache.h" #include "xil_printf.h" #include "xparameters.h" #include "../headers/bitmap.h" #include "xil_types.h" #include "xspi.h" #include "xspi_l.h" #include "xstatus.h" void DemoInitializeScreen(); void DemoRunScreen(); void DemoCleanupScreen(); void DemoInitializeDa(); void DemoRunDa(); void DemoCleanupDa(); void EnableCaches(); void DisableCaches(); PmodOLEDrgb oledrgb; PmodDA1 myDevice; u8 rgbUserFont[] = { 0x00, 0x04, 0x02, 0x1F, 0x02, 0x04, 0x00, 0x00, // 0x00 0x0E, 0x1F, 0x15, 0x1F, 0x17, 0x10, 0x1F, 0x0E, // 0x01 0x00, 0x1F, 0x11, 0x00, 0x00, 0x11, 0x1F, 0x00, // 0x02 0x00, 0x0A, 0x15, 0x11, 0x0A, 0x04, 0x00, 0x00, // 0x03 0x07, 0x0C, 0xFA, 0x2F, 0x2F, 0xFA, 0x0C, 0x07 // 0x04 }; // This table defines 5 user characters, although only one is used int main(void) { //DemoInitializeScreen(); //DemoRunScreen(); //DemoCleanupScreen(); DemoInitializeDa(); DemoRunDa(); DemoCleanupDa(); return 0; } void DemoInitializeScreen() { EnableCaches(); OLEDrgb_begin(&oledrgb, XPAR_PMODOLEDRGB_0_AXI_LITE_GPIO_BASEADDR, XPAR_PMODOLEDRGB_0_AXI_LITE_SPI_BASEADDR); } void DemoRunScreen() { char ch; // Define the user definable characters for (ch = 0; ch < 5; ch++) { OLEDrgb_DefUserChar(&oledrgb, ch, &rgbUserFont[ch * 8]); } OLEDrgb_SetCursor(&oledrgb, 2, 1); OLEDrgb_PutString(&oledrgb, "Starting Pmod DA1 demo..."); // Default color (green) //OLEDrgb_SetCursor(&oledrgb, 4, 4); //OLEDrgb_SetFontColor(&oledrgb, OLEDrgb_BuildRGB(0, 0, 255)); // Blue font //OLEDrgb_PutString(&oledrgb, "OledRGB"); //OLEDrgb_SetFontColor(&oledrgb, OLEDrgb_BuildRGB(200, 200, 44)); //OLEDrgb_SetCursor(&oledrgb, 1, 6); //OLEDrgb_PutChar(&oledrgb, 4); //OLEDrgb_SetFontColor(&oledrgb, OLEDrgb_BuildRGB(200, 12, 44)); //OLEDrgb_SetCursor(&oledrgb, 5, 6); //OLEDrgb_PutString(&oledrgb, "Demo"); // OLEDrgb_PutChar(&oledrgb, 0); //sleep(5); // Wait 5 seconds //OLEDrgb_DrawBitmap(&oledrgb, 0, 0, 95, 63, (u8*) tommy); } void DemoCleanupScreen() { //DisableCaches(); } void DemoInitializeDa() { EnableCaches(); DA1_begin(&myDevice, XPAR_PMODDPG1_0_AXI_LITE_SPI_BASEADDR); } void DemoRunDa() { xil_printf("Starting Pmod DA1 demo...\n\r"); u8 send[4]; send[0] = 0b00001000; send[1] = 0b00000000; send[2] = 0b00000000; send[3] = 0b00000001; XSpi_Transfer(&myDevice.DA1Spi, send, NULL, 4); while (1) { send[0] = 0b00000011; send[1] = 0b11111111; send[2] = 0b11111111; send[3] = 0b00000000; XSpi_Transfer(&myDevice.DA1Spi, send, NULL, 4); send[0] = 0b00000011; send[1] = 0b11110000; send[2] = 0b00000000; send[3] = 0b00000000; XSpi_Transfer(&myDevice.DA1Spi, send, NULL, 4); } } void DemoCleanupDa() { DA1_end(&myDevice); DisableCaches(); } void EnableCaches() { #ifdef __MICROBLAZE__ #ifdef XPAR_MICROBLAZE_USE_ICACHE Xil_ICacheEnable(); #endif #ifdef XPAR_MICROBLAZE_USE_DCACHE Xil_DCacheEnable(); #endif #endif } void DisableCaches() { #ifdef __MICROBLAZE__ #ifdef XPAR_MICROBLAZE_USE_DCACHE Xil_DCacheDisable(); #endif #ifdef XPAR_MICROBLAZE_USE_ICACHE Xil_ICacheDisable(); #endif #endif } /******************************************************************************/ /* */ /* PmodDA1.c -- Definitions for the PmodDA1 library */ /* */ /******************************************************************************/ /* Author: Jon Peyron */ /* Copyright 2017, Digilent Inc. */ /******************************************************************************/ /* File Description: */ /* */ /* This file defines the DA1 library functions to initialize and use the IP */ /* core. */ /* */ /******************************************************************************/ /* Revision History: */ /* */ /* 06/20/2016(JonP): Created */ /* 04/28/2017(ArtVVB): Validated */ /* 02/13/2018(atangzwj): Validated for Vivado 2017.4 */ /* */ /******************************************************************************/ /***************************** Include Files *******************************/ #include "../headers/PmodDA1.h" /************************** Function Definitions ***************************/ XSpi_Config DA1Config = { 0, 0, 1, 0, 1, 8, 0, 0, 0, 0, 0 }; /* ------------------------------------------------------------ */ /*** void DA1_begin(PmodDA1 *InstancePtr, u32 SPI_Address) ** ** Parameters: ** InstancePtr: A PmodDA1 object to start ** SPI_Address: The Base address of the PmodDA1 SPI ** ** Return Value: ** None ** ** Errors: ** None ** ** Description: ** Initialize the PmodDA1. */ void DA1_begin(PmodDA1 *InstancePtr, u32 SPI_Address) { DA1Config.BaseAddress = SPI_Address; DA1_SPIInit(&InstancePtr->DA1Spi); } /* ------------------------------------------------------------ */ /*** void DA1_end(PmodDA1 *InstancePtr) ** ** Parameters: ** InstancePtr - PmodDA1 object to stop ** ** Return Value: ** None ** ** Errors: ** None ** ** Description: ** Stops the device */ void DA1_end(PmodDA1 *InstancePtr) { XSpi_Stop(&InstancePtr->DA1Spi); } /* ------------------------------------------------------------ */ /*** DA1_SPIInit ** ** Parameters: ** None ** ** Return Value: ** None ** ** Errors: ** None ** ** Description: ** Initializes the PmodDA1 SPI. */ int DA1_SPIInit(XSpi *SpiInstancePtr) { int Status = 1; Status = XSpi_CfgInitialize(SpiInstancePtr, &DA1Config, DA1Config.BaseAddress); if (Status != XST_SUCCESS) { return XST_FAILURE; } u32 options = (XSP_MASTER_OPTION | XSP_CLK_ACTIVE_LOW_OPTION);// | XSP_MANUAL_SSELECT_OPTION; Status = XSpi_SetOptions(SpiInstancePtr, options); if (Status != XST_SUCCESS) { return XST_FAILURE; } Status = XSpi_SetSlaveSelect(SpiInstancePtr, 1); if (Status != XST_SUCCESS) { return XST_FAILURE; } /* * Start the SPI driver so that the device is enabled. */ XSpi_Start(SpiInstancePtr); /* * Disable Global interrupt to use polled mode operation */ XSpi_IntrGlobalDisable(SpiInstancePtr); return XST_SUCCESS; } /* ------------------------------------------------------------ */ /*** u8 DA1_WriteIntegerValue(PmodDA1 *InstancePtr, u8 bIntegerValue) ** ** Synopsis: ** WriteIntegerValue(0x00FF); ** ** Parameters: ** InstancePtr - A PmodDA1 object to start ** bIntegerValue - the 8-bit value to be written to DA converter ** ** Return Value: ** u8 - DA1_SPI_ERR_SUCCESS (0) - Action completed successfully ** - DA1_SPI_ERR_VAL_OUT_OF_RANGE (1) - Value is not within the ** 0x00 - 0xFF range ** Errors: ** If module is not initialized (using begin), the function does nothing. ** Also, see return value. ** ** Description: ** If the value is inside the allowed range (0 - 0xFF), this function ** writes the 12 bits value to the DA converter, by writing 16 bits to SPI ** and returns the DACSPI1_ERR_SUCCESS status message. If the value is ** outside the allowed range, the function does nothing and returns the ** DACSPI1_ERR_VAL_OUT_OF_RANGE message. ** */ u8 DA1_WriteIntegerValue(PmodDA1 *InstancePtr, u16 bIntegerValue) { u8 send[4]; u8 bResult = 0; u16 dataMaskFirstNib = 0x0F00; u16 dataMaskLastByte = 0x00FF; send[0] = DA1_SPI_CMD; send[1] = DA1_SPI_ADDR << 4 | (bIntegerValue & dataMaskFirstNib) >> 8; send[2] = bIntegerValue & dataMaskLastByte; send[3] = 0; if (bIntegerValue < 0 || bIntegerValue >= (1 << DA1_SPI_NO_BITS)) { bResult = DA1_SPI_ERR_VAL_OUT_OF_RANGE; } else { XSpi_Transfer(&InstancePtr->DA1Spi, send, NULL, 4); } return bResult; } /* ------------------------------------------------------------ */ /*** u8 DA1_WritePhysicalValue(PmodDA1 *InstancePtr, float dPhysicalValue) ** ** Parameters: ** InstancePtr - A PmodDA1 object to start ** dPhysicalValue - The physical value that must be reconstructed at the ** output of the DA converter ** ** Return Values: ** u8 - DA1_SPI_ERR_SUCCESS (0) - Action completed successfully ** - DA1_SPI_ERR_VAL_OUT_OF_RANGE (1) - The physical value is not inside ** accepted range ** ** Errors: ** If module is not initialized (using begin), the function does nothing. ** Also, see return value. ** ** Description: ** The function computes the integer value corresponding to the physical ** value by considering the reference value as the one corresponding to the ** maximum integer value (0xFF). If the integer value is within the ** accepted range (0 - 0xFF), this function writes the 12- bit value to the ** DA converter, by writing 8 bits to SPI, and returns the ** DACSPI1_ERR_SUCCESS message. If the integer value is outside the allowed ** range, the function does nothing and returns the ** DACSPI1_ERR_VAL_OUT_OF_RANGE message. If the dReference function ** argument is missing, 3.3 value is used as reference value. ** */ u8 DA1_WritePhysicalValue(PmodDA1 *InstancePtr, float dPhysicalValue) { u8 status; float dReference = 3.3; // The value corresponding to the maximum converter // value (reference voltage). If this parameter is // not provided, it has a default value of 3.3. u16 wIntegerValue = dPhysicalValue * (float) (1 << DA1_SPI_NO_BITS) / dReference; status = DA1_WriteIntegerValue(InstancePtr, wIntegerValue); return status; }
  2. Glad to hear deleting the other directories in the project fixed the errors. Unfortunately, we have not had time to make an IP Core for the PmodDA4. The PmodDPG1 has the same pin out as the Pmod DA4. I would use the PmodDPG1 IP Core and alter it to work with the Pmod DA4. I would use the arduino example here and the AD5628 datasheet as a reference for how to configure and use the Pmod DA4. Hey jpeyron, Bringing up this year old project again, Just wanted a sanity check here. I did a compare of the ip for the DA1 and the DPG1 and they are identical except for names. So I'm realizing from a hardware perspective, if it's a SPI interface to the AXI bus, it doesn't matter what's on the other side of the PMOD as long as the data direction is the same (MOSI/MISO; and even in this case it doesn't matter because even though the ref manual says some pins aren't hooked up, they are in the verilog code for the PMOD bridge.) any SPI IP will work. Thanks, Eddie
  3. Ok so I finally got it working. The module is fine. I had enabled instruction and data caches in the microblaze. After turning those off and regenerating everything I can now see Tom's wonderful smile. Thanks for the help
  4. Ok thanks that's good to know. I've been able to run the main.c from the oledrgp ip demo. it seems to be running, meaning the code is running. But there is nothing coming through onto the actual PMOD. I switched it to a high speed PMOD output on the arty thinking that might make a difference. Still nothing. Should I see the PMOD power on when i plug it into the arty? Im wondering if i have a bad module.
  5. Derp. I deleted the other directories in there and it generated fine.
  6. [Vivado 12-4406] The core container file 'C:/Xilinx/Vivado/2018.3/vivado-library/ip/Pmods/pmodOLEDrgb_v1_0/ip/PmodOLEDrgb_axi_quad_spi_0_0.xcix' cannot be added because it is sitting next to the IP directory 'C:/Xilinx/Vivado/2018.3/vivado-library/ip/Pmods/pmodOLEDrgb_v1_0/ip/PmodOLEDrgb_axi_quad_spi_0_0'. This configuration is not supported. Please move aside the IP directory and retry adding the file.
  7. Oh geez. You are right. Why is that main.c so different? Ok i'm trashing everything back to integrating the PMOD IP into my block diagram. How do I get the XCIX file to unpack? I am using the DA4. But I don't see an ip package for it in the vivado library. It only has DA1. Thanks for your help!
  8. OK. I figured this one out as well. I had my addressing messed up. I was trying to make the data section larger to accept the microblaze project and had changed the base address to something other than 0x00000000. The linker script got all confused. I changed it back to 0x00000000 and moved everything else up in memory. main() is now executing. The oledrgb still isn't working but I think I am missing some stuff in my microblaze setup. I'll see if i can figure it out. Thanks again.
  9. I see in your screenshot you have a MIG. Do I need that? Thanks!
  10. Here is my wrapper file as well. design_1_wrapper.v
  11. So i've actually been able to get it to work. I downloaded the original ip from a link in another forum post. It is ip that says it's for v1 of both of these modules, not sure if that makes a difference. I can generate a bitstream and have been able to export it and program the FPGA via the SDK. I'm now having an issue with not being able to hit any breakpoints once i'm in debug mode. the program counter looks to be stuck doing nothing. see image below. I can start another thread for this issue if need be. Thank you for your reply.
  12. Hello. I'm using a windows 10 64 bit machine. I've followed the getting started with PMODs tutorial and have a microblaze instantiated with my IP in place in the block diagram. I'm working with an OLEDrgb and a DA4. the OLEDrgb is hooked up to JA on the arty a7. the DA4 is hooked up to the JD port. I've downloaded the latest vivado library from github (version 2018.2). I've told vivado where the repository is and I was able to wire it up in the block diagram. I hooked up the correct 50Mhz clock to both of the PMODs. I get a positive design verification but when i try to generate my bitstream file, i get an error saying that Vivado can't find the xci file for the OLEDrgb ip. When I go and look in the folder "path/to/vivado-library/pmodOLEDrgb_v1_0_old/ip" i see the folder that vivado is trying to access the .xci file from but it is empty. instead there is just an xcix file sitting in the ip folder. I've tried enabling the Use ip Core functionality in the ip settings. If i do this, then i get another error when generating my bitstream file that is saying vivado couldn't unpack the ip core for the OLEDrgb. In the "Designing With IP" user guide, it says to enable the core ip functionality for just that module in my sources window. but I don't see the same drop down that it shows in the manual when i right click on my oledrgb pmod. Manual was probably using a different version of Vivado? Any suggestions? Thanks!