8 Replies Latest reply on Nov 2, 2017 12:17 AM by user_2864716

    Pin_Read() function not working


      I've been stuck with this problem with simple data read-in for a while now, I would appreciate any suggestion:


      I write a 3-bit request to an external module, which answers me with 3 bits of data. I checked everything with a scope, the module works properly and answers in 5V binary levels, But, i can't read this data with my CY8C5888AXI-LP096 input pins. I also tried writing mtdat value directrly to other pins, but no luck there either, I must be missing something obvious. Thank you


      int n; int MTMUX0[6]={1, 0, 1, 0, 1, 0}; /* 0bit of six different request codes*/ int MTMUX1[6]={0, 1, 1, 0, 0, 1}; /* 1bit of six different request codes*/ int MTMUX2[6]={0, 0, 0, 1, 1, 1}; /* 2bit of six different request codes*/ int MTDAT0[n]; /*array of 0bits of  module answers*/ int MTDAT1[n]; int MTDAT2[n];     for (;;) {         for (n=0; n<6; n++) {     MuxOut0_Write(MTMUX0[n]); /*write from MTMUX arrays to module*/       MuxOut1_Write(MTMUX1[n]);     MuxOut2_Write(MTMUX2[n]);           CyDelayUs(tdelay); /*delay*/     MTDAT0[n]=MtDat0_Read(); /*read from module into MTDAT arrays*/     MTDAT1[n]=MtDat1_Read();     MTDAT2[n]=MtDat2_Read(); }}