1 Reply Latest reply on Sep 20, 2012 12:48 AM by gaya

    about cy68013a code not run when download by EZ USB control pannel

    jianhua.shi

      Hello

         

      I now design a product use cy7c68013A. when the board is connect to PC, The PC can identify the USB device. And I also can download the Hex file. In my code,I need config two cmos sensor with I2C BUS.So I add the I2C code in TD_INIT function. But I can not find any wave in I2C BUS. So I doubt that the code maybe is not run. So I write a very small progran to test if the chipo is run. the program is :

         

      #include "E:\cypress\usb\target\inc\fx2.h"
      #include "E:\cypress\usb\target\inc\fx2regs.h"

         

      //#define ALLOCATE_EXTERN

         

      sbit SDA=IOC^7;            /*模拟I2C数据传送位*/
      sbit SCL=IOC^6;            /*模拟I2C时钟控制位*/

         

      void delay_1ms()
      {
         unsigned int j ;
         for(j=150;j>0;j--);
      }

         


      void delay_ms(unsigned int i)
      {
         for(;i>0;i--)delay_1ms();
      }
      main()
      {

         

      //PORTCCFG=0x00;
      OEC=0xFF;
      while(1)
      {

         

         SDA=1;
         SCL=1;
         delay_ms(5);
         SDA=0;
         SCL=0;
          delay_ms(5);
      }
      }  

         

      And I also can not measure any wave in I2C BUS.

         

      So please help me ? Where I had made some mistake?