Jump to content
  • 0

Reading Pmod AD1 value


wing

Question

Hello ,  I am using Pmod AD1 to get a analog value from a external sensor. And I am using SPI to receive data from AD1.

Now I use JA to connect with AD1 , so :
JA1<->CS
JA2<->D0

JA3<->D1

JA4<->CLK

is this a right approach? I use xdc file to route them:

##Pmod Header JA
    ##Sch name = JA1
    set_property PACKAGE_PIN Y11 [get_ports {ADC_CS}]                    
        set_property IOSTANDARD LVCMOS33 [get_ports {ADC_CS}]
    #Sch name = JA2
    set_property PACKAGE_PIN AA11 [get_ports {ADC_D0}]                    
        set_property IOSTANDARD LVCMOS33 [get_ports {ADC_D0}]
    ##Sch name = JA3
    set_property PACKAGE_PIN Y10 [get_ports {ADC_D1}]                    
        set_property IOSTANDARD LVCMOS33 [get_ports {ADC_D1}]
    ##Sch name = JA4
    set_property PACKAGE_PIN AA9 [get_ports {ADC_SCLK}]                    
        set_property IOSTANDARD LVCMOS33 [get_ports {ADC_SCLK}]
 

However, when I export to SDK , I dont know how to read the value from JA2 , is there any examples can show how can I read the value from AD1 via SPI?? I read some of the example but they are all using Pmod as output.

sorry for asking dumb questions, I am very new to FPGA 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

Hi @wing,

Welcome to the Digilent Forums!

Here is the resource center doe the Pmod AD1.

What FPGA are you using?

Based on your post, it looks like you are wanting to use the PmodAD1 with HDL(VHDL/Verilog) instead of Microblaze/Pmod IP cores.

2)  Is that correct?

If so here is a VHDL PmodAD1/Basys 3 Vivado project done by one of our community members @hamster . 

I have also attached the VHDL/UCF code and a PDF for an older ISE project that uses the PmodAD1 and the PmodDA2 that might be helpful.

 

best regards,

Jon

PmodAD1andPmodda2.zip

Link to comment
Share on other sites

Hi @jpeyron,

I am using zedboard zynq-7000.

Actually I tried using Pmod IP cores approach before. When I use the library from github: https://github.com/Digilent/vivado-library/tree/master/ip/Pmods/PmodAD1_v1_0

When I added this Pmod it looks like this in vivado:

image.png.b0ff70e7de2208697c525683b294dfe4.png

Since from my understanding , the AD1 has CS,D0,D1,CLK,VCC and GND as output and A0,A1, Gnd and Vcc as input pin , I dont quite understand how to connect it  to zedboard in IP block...

This is totally different from what I understand about AD1, also , what is the different between Pmod_out_pin1_o , Pmod_out_pin1_i and Pmod_out_pin1_t ?

image.png.f16c47ff9b41079d3f5099d4d2e7b4b2.png

Since I get very confuse in IP core approach , I changed to use VHDL and because I originally designed to get value from AD1 and do some calculation using C program, so I need to export to SDK. However , after reading some tutorial about using SPI on zedboard , I am still confuse about it. For the future development of my project , there still a chance that I need to do it on IP core approach. Is there any tutorial about getting data from AD1 using SPI? 
 Btw the example you gave it quite helpful on using VHDL on AD1 :)

Link to comment
Share on other sites

Hello wing,

In my experience Digilent project here is the most comprehesive use case of PmodAD1 on Zynq boards. It allows for running either continuos and single acquisition on both channels.

Also do a search of Digilent forum, you should find block diagrams related to you questions.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...