Jump to content
  • 0

Source Code in SDK


Ahmed Alfadhel

Question

Hi @jpeyron, @D@n , @Mahdi

I completed my block diagram design in Vivado, and I used Microblaze IP for AXI control, and PmodDA3 IP.  (1st picture)

But , I want to know how to assign Constraints to the JD Connector and what are source code that should be written in SDK ? 

I am using Arty 7. 

Kindly, see the attached pictures.

Looking forward your help.

Thanks .

design_completed.JPG

photo_2018-12-22_00-55-08.jpg

Link to comment
Share on other sites

Recommended Posts

Hi @jpeyron,

I altered the main.c code in PmodDA3 IP core, that you attached. 

As follow :

#include <stdio.h>
#include "xparameters.h"
#include "xil_cache.h"
#include "PmodDA3.h"
#include "xiomodule.h"

void DemoInitialize();
void DemoRun();


// Parameters
	u32 data, DAC_writing;


	XIOModule gpo;


// initialize our GPIO's
		data = XIOModule_Initialize(&gpo, XPAR_PMODDA3_0_DEVICE_ID);
		data = XIOModule_Start(&gpo);


PmodDA3 myDevice;

int main(void)
{
	Xil_ICacheEnable();
	Xil_DCacheEnable();


	while(1)
				{

					XIOModule_DiscreteWrite(&gpo, 1, data); // Perform DAC Reading

				}


	DemoInitialize();
	DemoRun();
	return 0;
}

void DemoInitialize()
{
	DA3_begin(&myDevice, XPAR_PMODDA3_0_AXI_LITE_GPIO_BASEADDR);
}


void DemoRun()
{

}

Am I on right way ?

And how to verify SPI signals on oscliioscpe ?

Thank you Mr Jon.

Link to comment
Share on other sites

Hi @Ahmed Alfadhel,

Looking through your previous post it appears that I gave you an incorrect generic IP core. The Pmod DA3 communicates through SPI as shown on the Pmod DA3 resource center here and not through GPIO. I have attached the correct generic SPI IP Core below. J6 is a SPI connector typically associated with the Arduino/Chipkit header and used with a shield like the MTDS.  Most of the Digilent SPI Pmod IP Cores are designed to use SPI through the Pmod Ports instead of the J6 connector.  

thank you,

Jon  

PmodDA3_v1_0.zip

Link to comment
Share on other sites

Hi Mr Jon ,

It seems an experienced procedure. 

One thing is unclear for me. Which is  you said I have to use an oscilloscope to verify SPI signals ! 

Do I need to SPI signals when using PmodDA3 module ? I am meaning that I am working with JA connector (GPIO) . Kindly, see the attached picture.

And what is the procedure to verify SPI signals ? is there any reference to do that?

thank u Mr Jon.

spi.JPG

Link to comment
Share on other sites

Hi @Ahmed Alfadhel,

In the Vivado block design you should use the board tab and select the pmod JD instead of the pmod JA. Unfortunately, we do not have the bandwidth to create the SDK code for the Pmod DA3.  Here is a list of our Pmod's that use the SPI communication like the Pmod DA3.  I would suggest to look at the IP Cores of the SPI communication Pmod's that are in the Vivado Library as a reference for you to make the SDK code for the Pmod DA3 IP core.  I would also use the Arduino code here and the datasheet here as a reference for configuring and using the Pmod DA3. Typically when I create an IP Core I first work on configuring the IC and setting up communication. This might require you to use a bread board and a o-scope to verify that the SPI signals are correct. Then I create the read and write functions. Lastly I manipulate the date to be in the form I would like it to be in. You should only need to alter the PmodDA3.c, PmodDA3.h and the main.c in the Pmod DA3 IP Core. 

thank you,

Jon

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...