Changeset 19


Ignore:
Timestamp:
Aug 29, 2009, 9:32:11 AM (15 years ago)
Author:
demin
Message:

fix OE bitmasks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FirmwareFX2/hw_basic.c

    r9 r19  
    2727//-----------------------------------------------------------------------------
    2828
    29 /* JTAG TDI, AS ASDI, PS DATA0 */
     29/* JTAG TDI */
    3030
    3131sbit at 0xB3          TDI; /* Port D.3 */
    32 #define bmTDIOE       bmBIT0
     32#define bmTDIOE       bmBIT3
    3333#define SetTDI(x)     do{TDI=(x);}while(0)
    3434
    35 /* JTAG TCK, AS/PS DCLK */
     35/* JTAG TCK */
    3636
    3737sbit at 0xB2          TCK; /* Port D.2 */
    38 #define bmTCKOE       bmBIT3
     38#define bmTCKOE       bmBIT2
    3939#define SetTCK(x)     do{TCK=(x);}while(0)
    4040
    41 /* JTAG TMS, AS/PS nCONFIG */
     41/* JTAG TMS */
    4242
    4343sbit at 0xB1          TMS; /* Port D.1 */
    44 #define bmTMSOE       bmBIT2
     44#define bmTMSOE       bmBIT1
    4545#define SetTMS(x)     do{TMS=(x);}while(0)
    4646
    47 /* JTAG TDO, AS/PS CONF_DONE */
     47/* JTAG TDO */
    4848
    4949sbit at 0xB0          TDO; /* Port D.0 */
    50 #define bmTDOOE       bmBIT1
     50#define bmTDOOE       bmBIT0
    5151#define GetTDO(x)     TDO
    5252
     
    5656
    5757  sbit at 0xB4        OELED; /* Port D.4 */
    58   #define bmOELEDOE   bmBIT7
     58  #define bmOELEDOE   bmBIT4
    5959  #define SetOELED(x) do{OELED=(x);}while(0)
    6060
     
    8888  CPUCS = bmCLKOE | bmCLKSPD1;
    8989
    90   // Use external clock, use "Slave FIFO" mode for all pins
    91   IFCONFIG = bmIFCFG1 | bmIFCFG0;
    92 
    93   // TDO input, others output
     90  // Use internal 48 MHz, enable output, use "Port" mode for all pins
     91  IFCONFIG = bmIFCLKSRC | bm3048MHZ | bmIFCLKOE | bmIFCFG1 | bmIFCFG0;
     92
     93  // Output enable (TDO input, others output)
    9494  OED = (OED&~bmPROGINOE) | bmPROGOUTOE;
    9595}
     
    101101   * d.0 => TCK
    102102   * d.1 => TMS
    103    * d.2 => nCE (only #ifdef HAVE_AS_MODE)
    104    * d.3 => nCS (only #ifdef HAVE_AS_MODE)
    105103   * d.4 => TDI
    106104   * d.5 => LED / Output Enable
     
    121119   *
    122120   * TDO => d.0
    123    * DATAOUT => d.1 (only #ifdef HAVE_AS_MODE)
    124121   */
    125122
    126123  ProgIO_Set_State(d);
    127   return 2|GetTDO(); /* DATAOUT assumed high, no AS mode */
     124  return 2|GetTDO();
    128125}
    129126
     
    132129void ProgIO_ShiftOut(unsigned char c)
    133130{
    134   /* Shift out byte C: 
     131  /* Shift out byte C:
    135132   *
    136133   * 8x {
     
    276273
    277274
    278 
Note: See TracChangeset for help on using the changeset viewer.