These are the examples provided for [[/users/frank26080115/libraries/LPC1700CMSIS_Lib/]] Note, the entire "program" is not compilable!

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers abstract.h Source File

abstract.h

00001  ******************** (C) COPYRIGHT 2010 NXPSemiconductors *******************
00002  * @file    PWM\Match_Interrupt\abstract.txt 
00003  * @author  NXP MCU SW Application Team
00004  * @version 2.0
00005  * @date    
00006  * @brief   Description of the MCPWM Match Interrupt example.
00007  ******************************************************************************
00008  * Software that is described herein is for illustrative purposes only
00009  * which provides customers with programming information regarding the
00010  * products. This software is supplied "AS IS" without any warranties.
00011  * NXP Semiconductors assumes no responsibility or liability for the
00012  * use of the software, conveys no license or title under any patent,
00013  * copyright, or mask work right to the product. NXP Semiconductors
00014  * reserves the right to make changes in the software without
00015  * notification. NXP Semiconductors also make no representation or
00016  * warranty that such application will be suitable for the specified
00017  * use without further testing or modification.
00018  ******************************************************************************
00019   
00020 @Example description:
00021     Purpose:
00022         This example describes how to use PWM Match function in interrupt mode.
00023     Process:
00024         This program illustrates the PWM signal on 6 Channels in single edge mode
00025         Peripheral clock for PWM: PWM_PCLK = CCLK / 4 = 72MHz/4 = 18MHz and there is no
00026         prescale for PWM. The PWM timer/counter clock is at 18MHz. The base rate is set to 256
00027         The base PWM frequency is at 18MHz/256 = 70.312 KHz (Period = ~14.22 microsecond)
00028         Each PWM channel (1 to 6) will be configured as following:
00029              + PWM1.1 = (10/256) (period = 0.56 microsecond) (P2.0)
00030              + PWM1.2 = (20/256) (period = 1.11 microsecond) (P2.1)
00031              + PWM1.3 = (30/256) (period = 1.67 microsecond) (P2.2)
00032              + PWM1.4 = (40/256) (period = 2.22 microsecond) (P2.3)
00033              + PWM1.5 = (50/256) (period = 2.78 microsecond) (P2.4)
00034              + PWM1.6 = (60/256) (period = 3.33 microsecond) (P2.5)
00035          Using Oscilloscope to observe the PWM signals
00036          Here, PWM1.1 value keeps changing, it will increase by the time from 0 to 256 period
00037          and restart. Match interrupt for channel 0 is set, when timer of PWM reach to 256
00038          (value of channel 0 match), an interrupt for matching will generate and update the
00039          value of PWM1.1, this value will be updated every 4096 match interrupts or:
00040          Period * 4096 = 14.22 * 4096 = 58,245 (microsecond)
00041          And this value will be reset to 0 after:
00042          Period * 4096 * 256 = 14,910,750.72 (microsecond) = ~15 (second)
00043 
00044 @Directory contents:
00045     \EWARM: includes EWARM (IAR) project and configuration files
00046     \Keil:  includes RVMDK (Keil)project and configuration files 
00047      
00048     lpc17xx_libcfg.h: Library configuration file - include needed driver library for this example 
00049     makefile: Example's makefile (to build with GNU toolchain)
00050     pwm_match_int.c: Main program
00051 
00052 @How to run:
00053     Hardware configuration:     
00054         This example was tested on:
00055             Keil MCB1700 with LPC1768 vers.1
00056                 These jumpers must be configured as following:
00057                 - VDDIO: ON
00058                 - VDDREGS: ON 
00059                 - VBUS: ON
00060                 - Remain jumpers: OFF
00061                 - The output signal can be observed by oscilloscope on these pins below:
00062             IAR LPC1768 KickStart vers.A
00063                 These jumpers must be configured as following:
00064                 - PWR_SEL: depend on power source
00065                 - DBG_EN : ON
00066                 - Remain jumpers: OFF
00067                 
00068             PWM pin selected:
00069                 Observe PWM wave signal on these pin
00070                 - PWM1.1 (channel 1): P2.0
00071                 - PWM1.2 (channel 2): P2.1
00072                 - PWM1.3 (channel 3): P2.2
00073                 - PWM1.4 (channel 4): P2.3
00074                 - PWM1.5 (channel 5): P2.4
00075                 - PWM1.6 (channel 6): P2.5
00076         
00077     
00078     Running mode:
00079         This example can run on RAM/ROM mode.
00080                     
00081         Note: If want to burn hex file to board by using Flash Magic, these jumpers need
00082         to be connected:
00083             - MCB1700 with LPC1768 ver.1:
00084                 + RST: ON
00085                 + ISP: ON
00086             - IAR LPC1768 KickStart vers.A:
00087                 + RST_E: ON
00088                 + ISP_E: ON
00089         
00090         (Please reference "LPC1000 Software Development Toolchain" - chapter 4 "Creating and working with
00091         LPC1000CMSIS project" for more information)
00092     
00093     Step to run:
00094         - Step 1: Build example.
00095         - Step 2: Burn hex file into board (if run on ROM mode)
00096         - Step 3: Configure hardware as above instruction 
00097         - Step 4: Run example, Use oscilloscope to monitor the wave form 
00098         
00099         (Pls see "LPC17xx Example Description" document - chapter "Examples > PWM > Match_Interrupt"
00100         for more details)
00101         
00102 @Tip:
00103     - Open \EWARM\*.eww project file to run example on IAR
00104     - Open \RVMDK\*.uvproj project file to run example on Keil