Table of Contents

1. Basic usage
2. How values from the file are truncated / preparing your data
3. Command line options and parameters

The ADC12 module is a 12bits, 16 channels input peripheral for the MSP430 micro controller. The WSim simulation model can be used to input predefined (files), random or constant data on each of the input ports. Almost all the registers are taken into account except registers that are used only to

1. Basic usage

The simulation model of the ADC12 only considers the numerical part of the block. The msp430 embedded software interface is thus the same as the real target with respect to timings and input sources.

ADC12 / MSP430 embedded software interface

Figure II.1. ADC12 / MSP430 embedded software interface


2. How values from the file are truncated / preparing your data

The file content is read at the beginning at the simulation and loaded in the simulator. If the simulation is long enough to consume all the data the ADC12 model restarts from the beginning and replays the already used samples.

Values are read from the input file at simulation start. Each value is truncated to 12 bits before being fed to the ADC12 device. As an example, consider the test input datafile that contains a serie from 0 to 12000. These valus will be read from the file and tracated to 12bits (4095 max). The mecanism is also true for signed values and the value -1 is converted to 4095 within the simulator.

ADC12 input data truncated at 4095d (12 bits), screenshot taken from gtkwave

Figure II.2. ADC12 input data truncated at 4095d (12 bits), screenshot taken from gtkwave


3. Command line options and parameters

Different sources and modes can be attached to hardware input channels. Each of the 12 inputs selected by the INCHx register within a configuration can be driven on the command line using the following parameters:

	  
--msp430_adc12=1:data1.dat,2:data2.dat
	  
	

Figure II.3. ADC12 command line option using HW channels 1 and 2 on two separate files


The previous example shows how to combine 2 different data files, one for each of the two adc channels that are used during the simulation. Hardware channel configurations are comma separated and a hardware configuration is a tuple [channel number]:[data file].