dev. boards/epm240 mini2014. 5. 23. 13:30

max II,  max V 계열 cpld 내부엔 oscillator 가 있다. 이 오실레이터의 테스트.

altera 홈페이지에서 AN 496: Using the Internal Oscillator in MAX II and MAX V CPLDs 를 참조했고, vhdl을 이용하여 테스트.

간단히하면, tool -> MegaWizard Plug-In Manager 선택. I/O에서 MAX II / MAX V Oscillator 선택. 그리고 오실레이터 이름 정하기. 여기에선 intOSC 로 이름지어 생성했다. 아래 코드는 이 오실레이터와의 인터페이스 예제.


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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
 
 
entity epm240_test_red is
 
    port (
        clk         :   in  std_logic;
        cout        :   out std_logic;
        intosc_out  :   out std_logic
    );
 
end epm240_test_red;
 
 
architecture arc of epm240_test_red is
 
    signal value            :   integer range 0 to 50000000;
    signal led              :   std_logic;
 
    signal  int_osc_out     :   std_logic;
    signal  int_count       :   integer range 0 to 50000000;
    signal  int_out         :   std_logic;
 
    component intOSC is
        port (
            oscena      :   in  std_logic;
            osc         :   out std_logic
        );
    end component;
 
begin
 
    process(clk)
    begin
     
        if (clk'event and clk = '1') then
         
            value <= value + 1;
             
            if (value = 10000000) then
                value <= 0;
                led <= not led;
            end if;
             
        end if;
 
    end process;
 
     
    OSC2: intOSC
        port map (
            oscena  =>   '1',
            osc     =>   int_osc_out
        );
     
 
    process(int_osc_out)
    begin
     
        if (int_osc_out'event and int_osc_out = '1') then
         
            int_count <= int_count + 1;
             
            if (int_count = 500000) then
                int_count <= 0;
                int_out <= not int_out;
            end if;
             
        end if;
 
        end process;
 
     
    cout <= led;
    intosc_out <= int_out;
 
end arc;



'dev. boards > epm240 mini' 카테고리의 다른 글

epm240 modules specifications  (0) 2014.05.23
epm240t100 modules  (0) 2014.05.23
Posted by 쿨한넘