UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Newbie tim55
Newbie
1,060 Views
Registered: ‎09-18-2017

Xilinx External Peripheral Controller EPC example for Microblaze and Vivado SDK

Hi,

 

I have successfully build the Microblaze processor and managed to get the GPIO example in SDK to work to flash an LED.

I have also learnt to use updatemem  in Vivado to update the bit file with the latest elf file (with implementing the design each time) with changes I made to see if the code was being updated and this works well.

I can change the LED that flashes and also the flashing speed from SDK, so I'm confident I've got the SDK - bitstream working well.

 

I now need to move to the next part of the project which is to interface an external device to the EPC (External Peripheral Controller) and use SDK to communicate with the EPC.

 

Does anyone know of an example that I could use to get started?

 

I have created the EPC in the Microblaze and the address range is visible in the SDK system.hdf view, but I don't know how to write to it in SDK.

 

Any help here would be much appreciated.

 

Thank you,

 

Tim

0 Kudos
2 Replies
Newbie tim55
Newbie
982 Views
Registered: ‎09-18-2017

Re: Xilinx External Peripheral Controller EPC example for Microblaze and Vivado SDK

Well I figured it out.

Here's what to do for anyone who is interested:

 

When exporting hardware from Vivado to SDK, a system.hdf file is created and sent to the SDK.

 

Here the memory address ranges of your Microblaze peripherals is listed.

 

For mine, the EPC address range is:0x43E00000 - 0x43E0FFFF

 

So in SDK, I use:

 

to write to EPC memory space:

 

#define EPC_BASE_ADDR     0x43E00000

#define ADCDTPFID         (EPC_BASE_ADDR + (ADCDTPFID_ADDR << 2))

 

Xil_Out32(ADCDTPFID, EPC_DATA_AA);

 

to read from EPC memory space:

uint32_t Read_data;

Read_data = Xil_In32(ADCDTPFID);

 

Base address is defined as starting address of EPC in Microblaze. Offset address is added to that address to read/write a specific location.

 

Easy when you know how!

0 Kudos
Moderator
Moderator
971 Views
Registered: ‎09-12-2007

Re: Xilinx External Peripheral Controller EPC example for Microblaze and Vivado SDK

There is example code in the driver you could use too
0 Kudos