Yeezy

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Yeezy

  • Rank
    Newbie

Profile Information

  • Gender Female
  1. I am testing infrared temperature sensor. It is connected to SP485(converter RS485 to RS232?) which is connected to ZYNQ,FPGA. write(fd,"1",1); // make gpio(enable pin) high. req_length = modbus_send_raw_request(ctx, raw_req, 6 * sizeof(uint8_t)); //write write(fd,"0",1);//After write(), make gpio low to receive messages from sensor. int response_length = modbus_receive_confirmation(ctx, rsp); This code was not working properly. Write() is not write immediately.. or the prosess is working independently.(so there is possibility that when I input Low, write() is not finished). I don't know reason actually. it's just my assuming. So I added usleep(); write(fd,"1",1); // make gpio(enable pin) high. req_length = modbus_send_raw_request(ctx, raw_req, 6 * sizeof(uint8_t)); //write usleep(9050); //waite until write is finished write(fd,"0",1);//After write(), make gpio low to receive messages from sensor. int response_length = modbus_receive_confirmation(ctx, rsp);` this code is working sometimes..... it also not the best answer. the result is here. After 1'22, it's working. enable Pin is connected to FPGA (ZYNQ) It is difficult to add other circuit to control enable pin. it is more convenience to make a design on the FPGA. should I control this by software?(controlling gpio) or Hardware? Let me know the best way, approach.. Thank you.