Changeset 19
- Timestamp:
- Aug 29, 2009, 9:32:11 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FirmwareFX2/hw_basic.c
r9 r19 27 27 //----------------------------------------------------------------------------- 28 28 29 /* JTAG TDI , AS ASDI, PS DATA0*/29 /* JTAG TDI */ 30 30 31 31 sbit at 0xB3 TDI; /* Port D.3 */ 32 #define bmTDIOE bmBIT 032 #define bmTDIOE bmBIT3 33 33 #define SetTDI(x) do{TDI=(x);}while(0) 34 34 35 /* JTAG TCK , AS/PS DCLK*/35 /* JTAG TCK */ 36 36 37 37 sbit at 0xB2 TCK; /* Port D.2 */ 38 #define bmTCKOE bmBIT 338 #define bmTCKOE bmBIT2 39 39 #define SetTCK(x) do{TCK=(x);}while(0) 40 40 41 /* JTAG TMS , AS/PS nCONFIG*/41 /* JTAG TMS */ 42 42 43 43 sbit at 0xB1 TMS; /* Port D.1 */ 44 #define bmTMSOE bmBIT 244 #define bmTMSOE bmBIT1 45 45 #define SetTMS(x) do{TMS=(x);}while(0) 46 46 47 /* JTAG TDO , AS/PS CONF_DONE*/47 /* JTAG TDO */ 48 48 49 49 sbit at 0xB0 TDO; /* Port D.0 */ 50 #define bmTDOOE bmBIT 150 #define bmTDOOE bmBIT0 51 51 #define GetTDO(x) TDO 52 52 … … 56 56 57 57 sbit at 0xB4 OELED; /* Port D.4 */ 58 #define bmOELEDOE bmBIT 758 #define bmOELEDOE bmBIT4 59 59 #define SetOELED(x) do{OELED=(x);}while(0) 60 60 … … 88 88 CPUCS = bmCLKOE | bmCLKSPD1; 89 89 90 // Use external clock, use "Slave FIFO" mode for all pins91 IFCONFIG = bmIFC FG1 | bmIFCFG0;92 93 // TDO input, others output90 // 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) 94 94 OED = (OED&~bmPROGINOE) | bmPROGOUTOE; 95 95 } … … 101 101 * d.0 => TCK 102 102 * d.1 => TMS 103 * d.2 => nCE (only #ifdef HAVE_AS_MODE)104 * d.3 => nCS (only #ifdef HAVE_AS_MODE)105 103 * d.4 => TDI 106 104 * d.5 => LED / Output Enable … … 121 119 * 122 120 * TDO => d.0 123 * DATAOUT => d.1 (only #ifdef HAVE_AS_MODE)124 121 */ 125 122 126 123 ProgIO_Set_State(d); 127 return 2|GetTDO(); /* DATAOUT assumed high, no AS mode */124 return 2|GetTDO(); 128 125 } 129 126 … … 132 129 void ProgIO_ShiftOut(unsigned char c) 133 130 { 134 /* Shift out byte C: 131 /* Shift out byte C: 135 132 * 136 133 * 8x { … … 276 273 277 274 278
Note:
See TracChangeset
for help on using the changeset viewer.