Kepler Lima

Members
  • Content Count

    19
  • Joined

  • Last visited

About Kepler Lima

  • Rank
    Member

Recent Profile Visitors

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

  1. Hello Jon, I have tried your PmodHoneywell IP, and I have the same value : 75 % The i2c is working because, I get that value. I think the problem must be in the configuration, maybe I chose the wrong registers to get the humidity. Maybe I should change the following command: Honeywell_sensor_begin(&myDevice,XPAR_PMODHONEYWELL_SENSOR_0_AXI_LITE_IIC_BASEADDR,0x18); Or maybe, it is that I don´t "wake up" the sensor... I don´t know how to do this last part. Should I take the main code that comes with PmodHoneywell and add some lines or? Im a bit lost as you can see. Thank you, Best regards
  2. Hello everyone, I am having some issues with my last purchase, the humidity and temperature sensor HONEYWELL HIH7120-021-001. It's working with an I2C protocol, and what I do is I connect it to a PMOD of the zybo. I built a circuit with two resistors of 2.2k and one capacitor, like it is written in the datasheet. I have thought about using the IP pmod tmp3, to configure this sensor, and I added some methods to PMODTMP3.c double TMP3_getHumidity(PmodTMP3 *InstancePtr) { double humidityResult; u16 uhResult = 0; int whResult = 0; u8 buf[4]; //Read humidity register into buf. TMP3_ReadIIC(InstancePtr, TMP3_REG_TEMP, buf, 2); uhResult = (buf[0] << 8) + buf[1]; whResult = (int)uhResult; //9 bit resolution has 0.5 *C resolution, stored in the uppermost 9 bits of the buffer. humidityResult = (double)whResult / 16382.0 * 100.0; return humidityResult; } double TMP3_getTemperature(PmodTMP3 *InstancePtr) { double temperatureResult; u16 utResult = 0; int wtResult = 0; u8 buf[4]; //Read temperature register into buf. TMP3_ReadIIC(InstancePtr, TMP3_REG_TEMP, buf, 2); utResult = (buf[2] << 6) + (buf[3] >> 2); wtResult = (int)utResult; //9 bit resolution has 0.5 *C resolution, stored in the uppermost 9 bits of the buffer. temperatureResult = (double)wtResult / 16382.0 * 165.0 - 40; return temperatureResult; } Actually I don't really care about the temperature in this sensor because I already have the pmodtmp3, but I need the humidity. I followed this link. I thought about modifying the TMP3.c because the pmod tmp3 uses the same communication protocol. It seemed to work, but actually its is not working, it always get the same value : 75 % of humidity. I put this lines in my main code : void DemoRun() { double humidity = 0.0; double temperature = 0.0; while(1) { humidity = TMP3_getHumidity(&myDevice); temperature = TMP3_getTemperature(&myDevice); xil_printf("\x1B[3;0H");//Move Terminal Cursor to beginning of current row(3) xil_printf("\x1B[1K");//Clear Terminal xil_printf("Humidity: %d % \n\r", humidity);//print float as in %.2f xil_printf("Temperature: %d % \n\r", temperature); TMP3_delay(2000000);//wait for a half second xil_printf("wait"); } } I don't know if someone ever used this kind of sensor for zybo. Hope you understand my problem. Thanks a lot to this website, you have helped me a lot with my project. Best regards, Kepler Lima
  3. I have tried many different things but its still not working. I need to get an oscilloscope to know if there is a signal going out. Thank you very much.
  4. Hello Jon, I have tried what you said, and then took the .c code from the example and modified it to do what I wanted, which is to press the 4 buttons of the zybo and change the PWM to change the quantity of lightning in my lamp. But im not sure about the code of the example, I don't really understand what it does. I attach you one .txt with my modified code. I followed what you said, and didn't do it like they do it in the tutorial, because they change the IP core. Just took the .c from them and modified as I wanted, but it doesn't work. Also I wanted to know when you modify the .xdc, for example we modify the port jb_p[0] and put pwm, which port is it? the one at the left or at the right of the board? Hope you can help me. Thanks a lot. Best regards. Kepler Laveran PWM_BUTTONS.txt
  5. Okay I tried what you said and its working. I have another doubt, but I don't know if I should write it here. I am looking forward to take out PWM signal from my ZYBO, from a "port" (Jb, Jc, etc...), so I can light a lamp that im going to connect from the outside. I have followed this tutorial, but i need to take out the PWM to connect it to an external circuit, instead of lighting the leds from ZYBO. Again maybe I should ask it in other forum. Thank you Jon, Hope you understand the purpose of my question, Best regards, Kepler Lima
  6. Oh okay I see, so it is easier than I thought. Thanks again. I will try your solution, an I will let you know if it works. Best regards
  7. Okay thanks to both. I will try your solution Jon. But I have one question, where can I see in the code .c, that I am selecting the right port? I mean if I configured my sensor of temperature in Je in Vivado, and imagine that I have another sensor, humidity for example, configured it in Jb, where in this code I can say that this is the correct port to take the temperature and the other port for humidity. I don't know if I explained myself correctly, hope you understand. Best regards Kepler Lima
  8. Hello everyone! I bought pmods from digilent site but im a bit blocked to configure them. I have downloaded the ip modals and followed a tutorial. Im in this moment with Pmod TMP3. I have configured it in "JE". Everything is ok. I attach you one pic of the block design in Vivado. Then I validate it, and generate bitstream and launch SDK. Now my question is, how do I do in SDK to configure my PMOD to get the temperature from this port. What should I write in the .c to get data from i2c in JE port, I tried to follow some tutorials that I found but I failed. Hope you understand what Im asking. Thank you. Best regards, Kepler Lima
  9. Hello Jon, Thanks a lot, it is working !!! That is exactly what I needed, but don't worry about the button, I mean the button I already have it in LabView. I just press it in the application and I send the string "Temperature" or "Humidity". So this part I already have done it. Now I just need to work on my sensors, to get the values. Thanks again! Kepler
  10. Okay I just need a method to read a String from the received packets. Because I made a GUI in LabView, by pressing a button the user sends the string "Temperature" or "Humidity", and i need the board to read these differents strings to know which value it has to send. Thank you Jon, without you I would still be blocked! Kepler
  11. Thanks Jon, EchoServer is finally working. Now I would like to modify the .c to receive something different. If the PC sends the string "Temperature" the board should answer "The temperature of the room is ...." instead of sending again "Temperature". I manage to answer with a different string: We just need to modify this line: if (tcp_sndbuf(tpcb) > p->len) { err = tcp_write(tpcb, p->payload, p->len, 1); } for this if (tcp_sndbuf(tpcb) > p->len) { err = tcp_write(tpcb, "The temperature is :\n\r", 22, 1); } The problem is that I want to read what it is sent also. To do something like if (tcp_read(tpcb,"Temperature\r",12,1)) err = tcp_write(tpcb, "The temperature is :\n\r", 22, 1); The problem is that im not sure how to read, im not even sure if tcp_read exists. Here is the main code : -------------------------------------------------------------------------- err_t recv_callback(void *arg, struct tcp_pcb *tpcb, struct pbuf *p, err_t err) { /* do not read the packet if we are not in ESTABLISHED state */ if (!p) { tcp_close(tpcb); tcp_recv(tpcb, NULL); return ERR_OK; } /* indicate that the packet has been received */ tcp_recved(tpcb, p->len); /* echo back the payload */ /* in this case, we assume that the payload is < TCP_SND_BUF */ if (tcp_sndbuf(tpcb) > p->len) { err = tcp_write(tpcb, p->payload, p->len, 1); } else xil_printf("no space in tcp_sndbuf\n\r"); /* free the received pbuf */ pbuf_free(p); return ERR_OK; } err_t accept_callback(void *arg, struct tcp_pcb *newpcb, err_t err) { static int connection = 1; /* set the receive callback for this connection */ tcp_recv(newpcb, recv_callback); /* just use an integer number indicating the connection id as the callback argument */ tcp_arg(newpcb, (void*)(UINTPTR)connection); /* increment for subsequent accepted connections */ connection++; return ERR_OK; } int start_application() { struct tcp_pcb *pcb; err_t err; unsigned port = 7; /* create new TCP PCB structure */ pcb = tcp_new(); if (!pcb) { xil_printf("Error creating PCB. Out of Memory\n\r"); return -1; } /* bind to specified @port */ err = tcp_bind(pcb, IP_ADDR_ANY, port); if (err != ERR_OK) { xil_printf("Unable to bind to port %d: err = %d\n\r", port, err); return -2; } /* we do not need any arguments to callback functions */ tcp_arg(pcb, NULL); /* listen for connections */ pcb = tcp_listen(pcb); if (!pcb) { xil_printf("Out of memory while tcp_listen\n\r"); return -3; } /* specify callback to use for incoming connections */ tcp_accept(pcb, accept_callback); xil_printf("TCP echo server started @ port %d\n\r", port); return 0; } ------------------------------------------------------------------------------------------------- I am sure it shouldnt be a big deal right? Hope you understand what I am asking. Thanks!! Kepler Lima Ferreira
  12. Hello Jon, Thanks for the help, I downloaded thef Vivado and SDK 2016.4, and im trying to try your project. But when Im in SDK after programming the FPGA, I get the following message " Unable to lunch The selection cannot be lunched". I have done everything in vivado, synthetise, implementation, generated the bitstream, i also added zybo board file. Then I exported the hardware with the bitstream. Launch SDK. And I can´t run it after programming the FPGA. I tried creating an application project with Hello World, and try to launch it in this project, but I still can´t launch it. Do you have any idea about how to solve this issue? Thank you. Kepler
  13. Hello, So with Petalinux I can be able to create a ethernet communication between ZYBO and PC as well? Instead of using vivado and all those problematics programs :D, im sorry im exhausted of trying different methods. I just want to send information of external sensors to my PC via ethernet. I know that a serial communication would be much easier, but that is the task I was asked for... I am bit desperate, after 1 month I still can´t manage to send data from the ZYBO to the PC via ethernet. If you have any suggestion please let me know, and thank your for your time, I am learning a lot! Kepler
  14. Hello Jon, Thanks for the answer. But I have some serious doubts about what petalinux is about. I mean I have downloaded ubuntu, I ran it in Vmware. I downloaded Vivado and SDK. And now what I want is to have an ethernet communication between Zybo and my PC. I mean, in the tutorial that Dan told me, I didnt see anything about Petalinux. I think I missunderstood many things or concepts maybe. Hope you can help me to see everything with clearer view. Thanks again, Kepler Lima
  15. Hello again, Im trying to put Linux in the ZYBO, following the steps in the link you send me. They suggest to follow the steps of the document "Getting Started with the Embedded Linux", I followed them all, but there is a step that I can't manage to do. Just before building the Linux Kernel. They say " Before building the kernel users must first download and install the ARM GNU tools from Xilinx. The installer and instructions for these Xilinx tools are available at: http://wiki.xilinx.com/zynq-tools." When I go to that link I see many differents things as Vivado, SDK, Petalinux, and many more. I am not sure of which files I need to download exactly. Hope you understand my problem. Thank you very much for your time. Best regards.