Felixx68
Newbie level 3
- Joined
- Mar 14, 2014
- Messages
- 3
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 21
Hello Guys,
New to EDA Board. I'm a student trying to write a program to receive bytes from a micro controller on an FPGA. There are 3 pins for the communication, data pin, enable pin, clock pin. I have written the following code and it receives, but the data it is showing to be received is wrong. Wondering if you guys can look at it and tell me what you think.
Thank you!
JMac
New to EDA Board. I'm a student trying to write a program to receive bytes from a micro controller on an FPGA. There are 3 pins for the communication, data pin, enable pin, clock pin. I have written the following code and it receives, but the data it is showing to be received is wrong. Wondering if you guys can look at it and tell me what you think.
Thank you!
JMac
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 module temp_rx( input clk, output [9:0]temp_raw, input data_rc, input enable_rc, input cnt_clk ); reg [15:0] temp_data; reg [9:0] temp_raw; reg busy; reg count = 1'b0; reg cnt_change; always @( posedge clk ) begin cnt_change = count^cnt_clk; if((enable_rc == 1'b1)) begin busy = 1'b1; if((cnt_change == 1'b1)) begin temp_data = temp_data << 1 temp_data[0] = data_rc; end else begin temp_data = temp_data; end end else begin busy = 1b'0; end count = cnt_clk; end always @( posedge clk ) begin if ((busy == 1'b0)) begin temp_raw <= temp_data; end end endmodule
Last edited: