• Content Count

  • Joined

  • Last visited

About theAsker

  • Rank
    Frequent Visitor

Recent Profile Visitors

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

  1. Hi @jpeyron thanks for your answer. both examples are looking very good. The problem is only, that the interrupt isn't working. Do I have to add the connection in the block diagram from eos_out to the zynq-block or from iip2intc_irpt? I also add my code at the bottom, maybe you can find my mistake! If it is correctly working at the end, I also will give you my project for other users. Because I think this is a very useful example at the end. #include <stdio.h> #include "platform.h" #include "xparameters.h" //#include "xgpio.h" #include "xadcps.h" #include "xscugic.h"
  2. I have to check this. Will there be problems, when the value always will change?
  3. theAsker

    Configuration: XADC

    I found the mistake. It is really a mess that it took me arround 6 hours to figure out, that I am reading to the wrong channel. Does someone know if bipolar mode with simultaneous sampling is slower than unipolar mode with simultaneous sampling
  4. theAsker

    Configuration: XADC

    I enabled in the XADC Wizard Block for Vaux6 and Vaux14 (my channels) bipolar. -no configurations now, only initialisation is added in the bare-metal code- How if I let read the channels i get much smaller values. Raw value is arround 350 now. Before that, the value was arround 1250 (330mV DC is connected). (Update: If I let the two inputs open, I also measure the same) So I think there is something happening in the conversion. But surly not the right .... Also if I change the cables + to - and - to + so I should measure -330mV, i get the same raw-value. Does someone have a
  5. theAsker

    Configuration: XADC

    I don't understand exactly what, I have to change? Could you help me here. There is for the XADC Wizard block the option to enable bipolar channels. But in the case, I am doing this, also nothing is happening... analog common mode is not interesting for me, cause I want my voltage +-0.5V arround 0V
  6. theAsker

    Configuration: XADC

    I added now all kind of configurations: XAdcPs_WriteInternalReg(xadc_ptr, XADCPS_CFR0_OFFSET, 0x8400); //bipolar mode XAdcPs_WriteInternalReg(xadc_ptr, XADCPS_CFR1_OFFSET, 0x4F0F); XAdcPs_WriteInternalReg(xadc_ptr, XADCPS_CFR2_OFFSET, 0x0400); In the first code line, the bipolar should be enabled. But if I change now the two cables of my input, the raw_values stays the same. Do you know, where my problem is?
  7. theAsker

    Configuration: XADC

    Hello everyone! I bought the Zybo Z7-20 board, and my aim is to convert 2 analog signals to digital signals via XADC in an simultaneous wy. For this I want to use the bare-metal programming in bipolar-mode (I am using Vivado IDE & SDK 2017.4). In the library xadcps.h I found nothing about the configuration to bipolar mode. Can anyone help me, telling which functions I need and how do I have to configurate them? Is there an example existing? Thanks for all help!
  8. I want to map the XADC from user space. I use for this: #define START_ADDRESS_XADC 0x43C00000 int fd = open("/dev/mem", O_RDWR|O_SYNC); char *ptr = (char *)mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, START_ADDRESS_XADC); when I want to write now to the registers like: ptr[ 0x40 ] = 0x8200; And I read the address before writing, it returns a 0. After writing, also a 0. So I think, a don't have permissions to write to this address. Why and how do I fix that?
  9. update: i figured out, that I can not write to the XADC registers the configuration. Can someone tell me why?
  10. Thanks for the response! About working with /dev/iio:deviceX it isn't writte so much down. And reading from files is in my application to slow. So I am back at my solution way with mapping from /dev/mem. So for it is working correctly. I am possible to map. But if i let the code run. I only get 0 for voltages. I read something, that you have to disable the driver. I tried it both ways, but nothing happend. Maybe you could have a look over my code and you're seeing my mistake right now. #include <stdio.h> #include <stdlib.h> #define XADC_START_ADDR
  11. Hello, I have some questions about application code of linux, for reading the external voltages. 1) At the moment I use the c++ commands:"path"); then file >> array; and at least file.close(); It there a much more gentil way to solve it. For example mmaping the registers directly to PS. I thought about using the "GPIO" mapping function for reading ports: *((volatile unsigned *)(gpio_base + offset)); Is this possible. And if yes, how will i figure out the gpio_base (of course I mean here the xadc_base) and the necessary offset? 2) Is there the possibili
  12. Hi! Thank you for your answer! I read now something and found out, that the interrupt from the xadc block is not as i expected. Do you have an idea, how I can (write a c++ code) read the external voltages so that i don't miss a value? Thought about adding in the block design a clock devider and then connect it via UIO to use it then as an interrupt? Do you have another idea, or how do you solve it, getting really all voltages read, you want?
  13. The important thing here is: I want an event driven sampling. so always when a new sample value is there, i want that it will be read! And it is absolutly not clear for me how to do it! I am really a newbie to this and I am feeling lost.... update question: in the path: /sys/bus/iio/devices/trigger1/ there is uevent. Is this my trigger? or when is the value inside uevent not 0! What is this uevent?
  14. Now I am also a bit confused. Cause I don't know which xadcread.cpp file you mean. To explain my problem a bit more: At the moment I read a voltage with the following code:"/sys/bus/iio/devices/iio\:device1/in_voltage9_vaux14_raw"); myvoltageIR >> voltage; myvoltageIR.close(); But know I want to do this only, when I get an interrupt from XADC. I also see, that there is an interrupt available: Cause if I do the following: $ cat /proc/interrupt \snip 46: 0 0 GIC-0 85 Level 43c00000.xadc_wiz \snip My problem now is, how do I build a c++ code/pr
  15. Thank you for your Answer! Are you having an c/c++ - example, how I can read the external voltages controlled via the interrupt with my petalinux?