Changeset 31 for trunk/MultiChannelUSB/Paella.v
- Timestamp:
- Sep 4, 2009, 10:16:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MultiChannelUSB/Paella.v
r30 r31 70 70 71 71 reg [31:0] counter; 72 reg led_reg; 72 73 // assign LED = counter[24]; 73 assign LED = usb_fifo_rx_empty; 74 // assign LED = ~usb_fifo_rx_empty; 75 assign LED = led_reg; 76 // assign LED = usb_fifo_led; 74 77 75 78 wire usb_wrreq, usb_rdreq, usb_rden, usb_pktend; … … 103 106 .tx_full(usb_fifo_tx_full), 104 107 .rx_empty(usb_fifo_rx_empty), 105 // .led(usb_fifo_led),106 . rx_data(usb_fifo_rx_data)108 .rx_data(usb_fifo_rx_data), 109 .led(usb_fifo_led) 107 110 ); 108 111 … … 216 219 2: 217 220 begin 221 usb_fifo_rx_rdreq <= ~usb_fifo_rx_empty; 218 222 if (~usb_fifo_rx_empty) 219 223 begin 220 usb_fifo_rx_rdreq <= 1'b1;221 224 case (usb_fifo_rx_data) 222 225 8'h30: … … 227 230 8'h31: 228 231 begin 232 led_reg <= 1'b1; 229 233 hst_addr <= 12'd0; 230 234 hst_byte_num <= 2'd0; … … 238 242 8'h33: 239 243 begin 244 led_reg <= 1'b0; 240 245 osc_addr <= osc_start_addr; 241 246 osc_counter <= 10'd0; … … 243 248 state1 <= 3'd4; 244 249 end 250 245 251 endcase 246 252 end 247 else248 begin249 usb_fifo_rx_rdreq <= 1'b0;250 end251 253 end 252 254 … … 254 256 begin 255 257 // hst transfer 258 usb_fifo_rx_rdreq <= 1'b0; 259 usb_fifo_tx_wrreq <= ~usb_fifo_tx_full; 256 260 if (~usb_fifo_tx_full) 257 261 begin 258 usb_fifo_tx_wrreq <= 1'b1;259 260 262 case (hst_byte_num) 261 263 2'd0: usb_fifo_tx_data <= hst_q[7:0]; … … 267 269 if (&hst_byte_num) 268 270 begin 269 hst_byte_num <= 2'd0;270 271 if (&hst_addr) 271 272 begin … … 277 278 end 278 279 end 279 else 280 begin 281 hst_byte_num <= hst_byte_num + 2'd1; 282 end 283 end 284 else 285 begin 286 usb_fifo_tx_wrreq <= 1'b0; 280 281 hst_byte_num <= hst_byte_num + 2'd1; 287 282 end 288 283 end … … 291 286 begin 292 287 // osc transfer 288 usb_fifo_rx_rdreq <= 1'b0; 289 usb_fifo_tx_wrreq <= ~usb_fifo_tx_full; 293 290 if(~usb_fifo_tx_full) 294 291 begin 295 usb_fifo_tx_wrreq <= 1'b1;296 297 292 case (osc_byte_num) 298 293 1'd0: usb_fifo_tx_data <= osc_q[7:0]; … … 302 297 if (osc_byte_num) 303 298 begin 304 osc_byte_num <= 1'd0;305 299 if (&osc_counter) 306 300 begin … … 313 307 end 314 308 end 315 else 316 begin 317 osc_byte_num <= 1'd1; 318 end 319 end 320 else 321 begin 322 usb_fifo_tx_wrreq <= 1'b0; 309 310 osc_byte_num <= ~osc_byte_num; 323 311 end 324 312 end … … 331 319 endcase 332 320 end 321 333 322 /* 334 323 always @(posedge CLK_50MHz)
Note:
See TracChangeset
for help on using the changeset viewer.