MLC interface driver
MLC driver main page
Author
Tomas Kosan
Version
1.0
Date
2012-2013

Introduction

This documentation describes developed driver named MLC_drv, which covers all hardware implemented in development platform MLC interface. It allows user of development platform to start it use quickly without knowing low level design of MLC interface. Most of functionality of driver is shown in MLC_test_main.c see this file for reference and example use of driver.

Change log:

Changes 5.6.2014:

  • Added address constants for external FPGA PWM module firmware.

Changes 16.4.2014:

  • added ADC init procedure to MLC_init() function.

Changes 21.03.2014:

  • added a new structure mlc_adc_result, which is suitable for overlap array of results from ADC. Then it is possible access each value by real index of input as defined in schematics.

Changes 13.11.2013:

  • LS3137 now supports full access to CPLD, FPGA and peripherals (ADC, DAC) on MLC interface
  • LS3137 can access external SRAM memory
  • MLC_ functions parameters and return values definitions was rewritten to fixed widths, i.e. unsigned int is now replaced by uint16_t. This change solves differences between C2000 and R4F platform integer sizes. Using types with exact number of bits is highly recommended.

Changes 14.10.2013:

  • added almost full support for TMS320F2812, except DMA transfers (not supported on 2812) and ADC conversion end interrupt.
  • implemented basic support for TMS570LS3137
  • there are now three projects, each for one platform, these depends on each other it means that all of them should be imported to workspace !

Changes 20.8.2013:

Changes 16.8.2013:

  • SCI driver has extended functionality + added support for FIFO, see SCI documentation.
  • MLC_driver was moved to stand-alone CCS project, this behavior allows us to use it as a library
  • also TI sources for 28335 peripherals was moved to project tree of MLC_driver and they are linked to library, therefore you should not use it in project ! See folders includeTI and src, which files are included. However it can be used as part of project, then just copy MLC_drv.c and .h to your project and add also TI sources.

Changes 1.6.2013:

Changes 21.5.2013:

  • DAC driver is now part of MLC_drv, see DAC documentation.
  • LCD driver is now part of MLC_drv, see LCD documentation.
  • new debug macros, see DEBUG documentation.
  • full support for DMA transfers and interrupts from AD converters, see ADC documentation.
  • added support for external RAM, it can be size of 128kB (compatible with eZdsp28335) or 256kB, however then button S7 will not work, see documentation.
  • added support for global enable signal, useful for CPLD/FPGA to detect DSP reset condition. Requires CPLD firmware at least 0.4. See documentation.

Using driver in as part of your project

Step 1: Install driver

Driver uses four files, MLC_drv.h, MLC_drv_config.h, platform.h and MLC_drv.c. Add them to your project, include header file MLC_drv.h and you are done. However driver depends on TI's DSP2833x_Device.h and DSP2833x_Examples.h or DSP281x_Device.h and DSP281x_Examples.h or ARM headers and sources, depending on DSP used. Those have to be added to your project as well. File platform.h is used to define type of MCU used in project. It must be set properly, otherwise project will not compile.

Step 2: Minimal startup code

Function MLC_init() must be called first, before any other function of MLC driver. Than we can use rest of functions and macros of driver to configure and access peripherals available on MLC interface board.

Using driver as library

Step 1: Install driver library - RECOMENDED

Driver is standalone CCS static library project, but it is splitted to three supported platforms: MLC_interface_lib, MLC_interface_lib_2812 and MLC_interface_lib_LS3137. This behavior is needed because each platform must have special settings for compiler etc. The MLC_interface_lib project is basic implementation of driver and other two depends on it.

This project has to be imported to your workspace and should have name MLC_interface_lib. MLC_interface_lib is suitable for TMS320F28335 development and does not have any additional depencies.

Recommended way of using driver libs is: 1/ download sources of demo project and proper library from SVN.

  • for TMS320F28335: MLC_test_v2 and MLC_interface_lib
  • for TMS320F2812: MLC_test_v2_2812, MLC_interface_lib_2812 and MLC_interface_lib
  • for TMS570LS3137: MLC_test_v2_LS3137, MLC_interface_lib_LS3137 and MLC_interface_lib

Then import all projects to workspace, let the CCS to copy them to your workspace, otherwise you risk, that project will be changing during time as a new versions will be commited to SVN. All three demos and libraries are setup to work out of the box after sucessfull import to workspace.

If somethings goes wrong below is shown setup of demo project for TMS320F28335. Project for TMS320F28335 which wants use this library driver must have these settings:

setup_inc.png
1/ Compiler should have include dirs set.
setup_lib.png
2/ Linker should have library search set.
setup_ref.png
3/ Project should reference to driver library.

Simplest way how to use library driver is to create copy of MLC_test_v2 project under different name and replace its source with your sources.

Configuration of driver

Drivers configuration is held in file MLC_drv_config.h. This file consist of defines which controls driver behavior.

Quick start

Documentation of functions are grouped by purpose in Modules tab, brief documentation can be found here. You can quickly access documentation for:

  • Main macros and functions here.
  • AD converters here.
  • DA converter here.
  • LCD display here.
  • External addresses here.
  • Debug utils here.
  • SCI functions are here

TODO:

Improve support for TMS570LS3137, add support for RICE BSL system for Hercules MCU.