how to connect UART to USB by fsa9480?

General discussion and feedback on development topics

how to connect UART to USB by fsa9480?

Postby cx_star » Thu Jul 18, 2013 6:09 pm

although it has been implemented, but i donn't know how it work. i am poor to understand by reading code of JetDroid or JetKernel.

what i have done:
1`my program can communicate with fsa9480 by usbsw_scl_3.0v and usbsw_sda_3.0v(gpk6 and pgk7).
i have read some register from fsa9480 :
Code: Select all
//readByte1 from 00000000 : 00000000 !
   //readByte1 from 00000001 : 00000028 !
   //readByte1 from 00000007 : 0000001f !
   //readByte1 from 0000001b : 00000008 !
   //readByte1 from 0000001c : 00000040 !
   //readByte1 from 0000001d : 00000001 !


2` NLAST9431. make GPQ2(UART_SEL)=1,then IF_TXD <--> AP_TXD , IF_TXD <--> AP_RXD
i do this by:
Code: Select all
   //uart_sel  GPQ2=1 CON[5:4]=01:out PUP[5:4]=10:up
    reg = GPQCON_REG;
    reg &= 0xffffffcf;   // 1100 1111
    reg |= 0x00000010;   // 0001 0000
    GPQCON_REG = reg;

    reg = GPQPUD_REG;
    reg &= 0xffffffcf;   // 1100 1111
    reg |= 0x00000020;   // 0010 0000
    GPQPUD_REG = reg;
      
   GPQDAT_REG |= 0x00000004;// 0000 0100


3` then write 0x1a to fsa9480'REGISTER_CONTROL(0x02) and write 0x6c to REGISTER_MANUALSW1
like this:
Code: Select all
        #define SW_UART         ((3 << 5) | (3 << 2))
   writeByte(devID,REGISTER_CONTROL,0x1a);
   writeByte(devID,REGISTER_MANUALSW1,SW_UART);


4` make GPB[1:0]=1 or =0 , but the usb_dp/usb_dm no any signal
Code: Select all
   //test
   //AP_RXD: GPB0  CON[3:0]=0001:out
   //AP_TXD: GPB1  CON[7:4]=0001:out
   reg = GPBCON_REG;
    reg &= 0xffffff00;
    reg |= 0x00000011;  //
    GPBCON_REG = reg;
   
   reg = GPBPUD_REG;
    reg &= 0xfffffff0;   // 1111 0000
    reg |= 0x0000000a;   // 0000 1010
    GPBPUD_REG = reg;

   
   debug();

   ret = 100;
   while(ret--)
    {
        if(ret&0x1)
         GPBDAT_REG |= 0x00000003;//
       else
         GPBDAT_REG &= ~(0x00000003);
      myprintf("haha %x %x\r\n",ret,GPBDAT_REG);
      delay_s(1);
   }



all code (boot from tf)
mytf_iicOK_but_not work.rar
You do not have the required permissions to view the files attached to this post.
cx_star
Junior member
Junior member
 
Posts: 42
Joined: Mon Dec 27, 2010 9:56 am

Advertisement

       

Return to Development Discussion / Feedback

Who is online

Users browsing this forum: No registered users and 1 guest

  • Advertisement
cron