Generation of Square Wave

  1. Purpose

    In this section, square wave which repeats 0[V] and 1[V] alternatively, is generated and measured by an oscilloscope.
    A D/A converter is utilized to output analog voltage.

  2. Materials

  3. Compilation of the module
    To compile the module, simply type `make' on kterm window such as:
    % make
    	
    As the result, the module `rect_module.o' is generated if the compilation process is successfully completed without errors.


  4. Installation of the module

    Firstly, check the modules now installed and confirm that there is no real time task module:
    % lsmod
    Module                  Size  Used by    Tainted: PF 
    mbuff                   8492   0
    rtl_sched              30368   0
    rtl_fifo               10848   0 (unused)
    rtl_posixio             8052   0 [rtl_fifo]
    rtl_time                7084   0 [rtl_sched rtl_posixio]
    rtl                    21232   0 [rtl_sched rtl_fifo rtl_posixio rtl_time]
    vmnet                  23656   6
    vmmon                  27444   0 (unused)
    	
    Next, install the module `rect_module.o' by the command `insmod' such as:
    % insmod rect_module.o
    Warning: loading rect_module.o will taint the kernel: no license
      See http://www.tux.org/lkml/#export-tainted for information about tainted modules
    Module rect_module loaded, with warnings
    	
    Check if the module is installed correctly:
    % lsmod
    Module                  Size  Used by    Tainted: PF 
    rect_module             1872   0 (unused) <--- This means the module is installed correctly.
    mbuff                   8492   0
    rtl_sched              30368   0 [rect_module]
    rtl_fifo               10848   0 (unused)
    rtl_posixio             8052   0 [rtl_fifo]
    rtl_time                7084   0 [rect_module rtl_sched rtl_posixio]
    rtl                    21232   0 [rtl_sched rtl_fifo rtl_posixio rtl_time]
    vmnet                  23656   6
    vmmon                  27444   0 (unused)
    	
    Now, the square wave has been occurred on D/A board.
    Check the wave form by the oscilloscope.

  5. Unload the module

    Finally, unload the module to stop the wave generation by the command `rmmod':
    % rmmod rect_module
    	
    Confirm that the module is unloaded correctly:
    % lsmod
    Module                  Size  Used by    Tainted: PF 
    mbuff                   8492   0
    rtl_sched              30368   0
    rtl_fifo               10848   0 (unused)
    rtl_posixio             8052   0 [rtl_fifo]
    rtl_time                7084   0 [rtl_sched rtl_posixio]
    rtl                    21232   0 [rtl_sched rtl_fifo rtl_posixio rtl_time]
    vmnet                  23656   6
    vmmon                  27444   0 (unused)
    	
  6. You can change the period and/or amplitude of the square wave.
    Edit the file `rect_module.c' by using the text editor xemacs.
    Then, repeat the process in this page again.


Yasuhide Kobayashi
Last modified: Tue Jul 6 13:02:13 JST 2004