EQuestionAnswers.com Computer/Electronics Questions and Answers
C, C++, VC++, COM/DCOM, DLL and more
#Login #Sign up  Facebook Twitter TGoogle+
 

#Previous Topic #Index #Next Topic

Our Pluto I board has Altera ACEX1K Family and Chip is EP1K10TC100-3. Pin Connections-

  • CLK-71
  • INT-70
  • ADDR-26
  • data-6
  • wr-23
  • rd-28
  • wait-50
  • INT3-70

module ledmmio(clk, LED,ADDR,wr,rd,data,rdwait,intt);
input clk;
output LED;
input ADDR;
input wr;
input rd;
inout data;
inout rdwait;
inout intt;
10  reg [0:0]rdwait1;
11  reg [0:0]data1;
12  reg [0:0]data2 = 0;
13  reg [0:0]LEDval = 0;
14  reg [0:0]intt1 = 1;
15  reg [4:0]timer = 0;
16 
17  always @(posedge clk)
18   
19    begin
20      if(ADDR == 0 && rd == 0) /*Read*/
21        begin
22          data1 = data2;
23          LEDval <= data2;
24          rdwait1 <= 1'b0;
25          intt1 <= 1'bz;
26          timer = 1;
27       end
28    else if(ADDR == 0 && wr == 0) /*Write*/
29      begin
30        data1 = (data);
31        LEDval <=data1;
32        data2 = data1;
33        rdwait1 <=1'b0;
34        intt1 <= 1'bz;
35        timer = 1;
36      end
37    else /*Not in Read/Write*/
38      begin 
39        if(timer > 0) /*Int gen after some clk cylc*/
40          begin
41            if(timer > 28 && timer <= 31) intt1 <= 1'b0;
42            timer = (timer == 5'b11111) ? 0 : timer + 1'b1;
43          end
44        data1 = 1'bz;
45        rdwait1 <= 1'bz;
46        if(timer == 0)intt1 <= 1'bz;
47      end
48    end
49  assign data = data1;
50  assign LED = LEDval;
51  assign rdwait = rdwait1;
52  assign intt = intt1;
53  endmodule
54 

Please note - wr, rd, wait, INT and ADDR (Chip Select) are all negative logic signals. Zero means they have been activated.

You have viewed 1 page out of 14. Your learning is 0.00% complete. Login to check your learning progress.

 Vote 0

Similar topics related to this section

Altera FPGA interfacing ARM, ARM CPU internals, ARM CPU, Cache Memory and MMU, ARM bus hierarchy, ARM data, address and control lines, ARM MMIO read, ARM MMIO write, FPGA interfacing with system bus, VHDL/Verilog program, ADS C Code, Linux Direct MMIO App, Linux Device Driver, Linux Application code, Final Demo,

* #1 webmaster Tue 15 Apr/2014 04:42:15(GMT)  Like 0 Unlike 0

Dear Users,

We are pleased to inform you that a forum/blog has been incorporated with www.equestionanswers.com. You are welcomed to add your comments, requests, codes, solutions and feedback to it. Please login(if already a member) or signup(for free) to avail to this facility.

Regards,
Webmaster

Your message goes here:

Name:Guest
Email:anonymous@unknown.com
My Post:*
Secutiry Code: ******  *
Preview this compose before posting this in discussion forum.
 
Note:
  1. Use [Sxx] code to show smiles. Example [S02]
  2. Use [URL ], example [URL http://www.google.com/]
  3. To display code or un formatted text use [CODE] [/CODE]. Example: [CODE] printf("Hello world"); [/CODE]
 [S01]   [S02]   [S03]   [S04]   [S05]   [S06]   [S07]   [S08] 
 [S09]   [S10]   [S11]   [S12]   [S13]   [S14]   [S15]   [S16] 
 [S17]   [S18]   [S19]   [S20]   [S21]   [S22]   [S23]   [S24] 

Note: Only members are allowed, * fields are mandatory.