VSK-2148 (Revised)
VSK-2148 (Revised)
The ARM7 LPC2148 starter kit is based on a 32/16 Bit ARM7TDMI-s CPU with real time
Emulation and Embedded Trace support, That combines with the microcontroller with embedded
high speed 512KB flash memory. It can work with 16-bit Thumb Mode.
With Useful Implemented peripherals, plentiful practical code examples and a broad set of
additional on board. VSK-2148 board make fast and reliable tools that can satisfy the needs of
experienced engineers and beginners alike.
VSK-2148 Boards achieve their small size through Modern SMD technology and Multilayer
Design. All Controller signals and ports extend from the controller to high density pitch
Connectors of the board.
VSK-2148 Hardware Manual Describes the board’s design and functions. Precise Specifications for
the NXP LPC2148 Microcontroller can be found in the enclosed Microcontroller Data
sheet/User’s Manual. In this hardware manual, schematic diagrams and Block Diagrams are
attached.
The IAR Embedded Workbench® IDE is a very powerful Integrated Development Environment,
that allows you to develop and manage complete embedded application projects. It is a
development platform, with all the features you would expect to find in your everyday working
place.
The IDE is the framework where all necessary tools are seamlessly integrated:
* A powerful editor
* A project manager
IAR Embedded Workbench is available for many microprocessors and microcontrollers in the 8-,
16-, and 32-bit segments, allowing you to stay within a well-known development environment
also for your next project. It provides an easy-to-learn and highly efficient development
environment with maximum code inheritance capabilities, comprehensive and specific target
support. IAR Embedded Workbench promotes a useful working methodology, and you can
reduce your development time significantly by using the IAR Systems tools. We call this concept
“Different Architectures. One Solution.”
The IAR C/C++ Compiler for ARM is a state-of-the-art compiler that offers the standard features
of the C or C++ languages, plus many extensions designed to take advantage of the ARM- specific
facilities. The compiler is integrated with other IAR Systems software in the IDE.
FEATURES
CODE GENERATION
LANGUAGE FACILITIES
* Support for IAR Extended EC++ with features such as full template support, namespace
support, the cast operators static_cast, const_cast, and reinterpret_cast, as well as the
Standard Template Library (STL).
IAR Assembler
The IAR Assembler is integrated with other IAR Systems software for the ARM core. It is a
powerful relocating macro assembler (supporting the Intel/Motorola style) with a versatile set of
directives and expression operators. The assembler features a built-in C language preprocessor and
supports conditional assembly. The assembler uses the same mnemonics and operand syntax as
the Advanced RISC Machines Ltd Assembler for ARM, which simplifies the migration of existing
code
FEATURES
* C preprocessor
* List file with extensive cross-reference output
* Number of symbols and program size limited only by available memory
* Support for complex expressions with external references
* 255 significant characters in symbol names
* Support for ARM EABI ELF/DWARF object format.
IAR Embedded Workbench Installation is completed , Shortcut ICON is placed at your desktop.
Just make an double click on that ICON. New Window is open as given below.
1. To create a new project, choose Project>Create New Project. The Create New Project dialog
box appears, which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an
empty project that uses default project setting.
4. In the standard Save As dialog box that appears, specify where you want to place your
project file, that is, in your newly created projects directory. Type your project name in
the File name box, and click Save to create the new project. eg. LED.
To Creating your Application ‘C’ file, Choose FILE menu and select NEW>File.
To Save your ‘C’ file, Choose File>Save As. In the standard Save As dialog box that appears,
specify where you want to place your project file, that is, in your project directory. Type your
filename in the File name box, and click Save to create the new project. Eg. Led.c
1. In the Workspace window, select the destination to which you want to add a source file; a
group or, as in this case, directly to the project.
2. Choose Project>Add Files to open a standard browse dialog box. Locate the files led.c
select them in the file selection list, and click Open to add them to the project1 project.
To save your work space, Choose File>Save Workspace and specify where you want to place your
workspace file. In this tutorial, you should place it in your newly created project directory. Type
LED in the File name box, and click Save button.
Now you will set the project options. For application projects, options can be set on all levels of
nodes. First you will set the general options to suit the processor configuration in this tutorial.
Because these options must be the same for the whole build configuration, they must be set on the
project node.
1. Select the project folder icon LED - Debug in the Workspace window and choose
Project>Options. Then select Output Converter in the Category list to display the linker
option pages.
The Output options are used for specifying details about the output format and the level of
debugging information included in the output file.
Select “option” on the popup menu. After selecting popup menu window shows as given below.
Select output format as “ Intel Extended”, output file in the format of .hex format.
Select the linker file menu, linker configuration file available at project directory.
If your project has no error Building completed and Hex file generated
1. To create a new project, choose Project>Create New Project. The Create New Project
dialog box appears, which lets you base your new project on a project template.
2. Make sure the Tool chain is set to ARM, and click OK.
3. Select the project template Empty project, and click ok button. Which simply creates an
empty project that uses default project settings.
4. In the standard Save As dialog box that appears, specify where you want to place your
project file, that is, in your newly created projects directory. Type your project name in
the File name box, and click Save to create the new project. eg. UART.
RTOS Package comprises set of ‘C’ files and headed files. C Files are classified as Application file,
CPU files, µC/OS-II Files and BSP.
In this project, we have to split the C files according to the functions. So these files are integrate
under separate folder.
i) APP
ii) BSP
iii) UCOS-II
a) PORT
b) SOURCE
1. Creating several groups is a possibility for you to organize your source files logically
according to your project needs.
Under ucos-ii group, create two group named as source and ports.
Now you will set the project options. For application projects, options can be set on all levels of
nodes. First you will set the general options to suit the processor configuration in this tutorial.
Because these options must be the same for the whole build configuration, they must be set on the
project node.
1. Select the project folder icon UART - Debug in the Workspace window and choose
Project>Options. Then select C/C++ Compiler where you have select CODE menu ,
enable ARM Processor Mode.
$PROJ_DIR$
$PROJ_DIR$\..\uCOS-II\ports
$PROJ_DIR$\..\uCOS-II\source
$PROJ_DIR$\..\BSP
$PROJ_DIR$\..\CPU
For Creating the Hex file, we choose output file format as given below.
If there is no error, Message window shows like this. Now Hex file is created.
ISP UTILITY
NXP Semiconductors produce a range of Microcontrollers that feature both on-chip Flash
memory and the ability to be reprogrammed using In-System Programming technology. Flash
Magic is Windows software that allows easy access to all the ISP features provided by the devices.
These features include:
Under Windows, only one application may have access the COM Port at any one time,
preventing other applications from using the COM Port. Flash Magic only obtains access to the
selected COM Port when ISP operations are being performed. This means that other applications
that need to use the COM Port, such as debugging tools, may be used while Flash Magic is loaded.
Note that in this manual third party Compilers are listed alphabetically. No preferences are
indicated or implied.
Procedure:
Processing
HARDWARE DETAILS
The LPC2148 microcontrollers are based on a 32/16 bit ARM7TDMI-S CPU with real-time
emulation and embedded trace support, that combines the microcontroller with embedded high
speed flash memory ranging from 32 kB to 512 kB. A 128-bit wide memory interface and unique
accelerator architecture enable 32-bit code execution at the maximum clock rate. For critical code
size applications, the alternative 16-bit Thumb mode reduces code by more than 30% with
minimal performance penalty.
Due to their tiny size and low power consumption, LPC2148 are ideal for applications where
miniaturization is a key requirement, such as access control and point-of-sale. A blend of serial
communications interfaces ranging from a USB 2.0 Full Speed device, multiple UARTS, SPI, SSP
to I2Cs and on-chip SRAM of 8 kB up to 40 kB, make these devices very well suited for
communication gateways and protocol converters, soft modems, voice recognition and low end
imaging, providing both large buffer size and high processing power. Various 32-bit timers, single
or dual 10-bit ADC(s), 10-bit DAC, PWM channels and 45 fast GPIO lines with up to nine edge or
level sensitive external interrupt pins make these microcontrollers particularly suitable for
industrial control and medical systems.
Features:
* Single flash sector or full chip erase in 400 ms & programming of 256 bytes in 1 ms.
* Embedded ICE RT and Embedded Trace interfaces offer real-time debugging with the on-chip
Real Monitor software and high speed tracing of instruction execution.
* USB 2.0 Full Speed compliant Device Controller with 2 kB of endpoint RAM. In addition, the
LPC2146/8 provide 8 kB of on-chip RAM accessible to USB by DMA.
* One or two (LPC2141/2 vs LPC2144/6/8) 10-bit A/D converters provide a total of 6/14 analog
inputs, with conversion times as low as 2.44 s per channel.
* Two 32-bit timers/external event counters (with four capture and four compare channels
each), PWM unit (six outputs) and watchdog.
* Low power real-time clock with independent power and dedicated 32 kHz clock input.
* Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 Kbit/s), SPI
and SSP with buffering and variable data length capabilities.
* On-chip integrated oscillator operates with an external crystal range from 1 MHz to 30 MHz
and with an external oscillator up to 50 MHz.
* Processor wake-up from Power-down mode via external interrupt, USB, Brown-Out Detect
(BOD) or Real-Time Clock (RTC).
* Single power supply chip with Power-On Reset (POR) and BOD circuits:
Vi Microsystems Pvt. Ltd., [ 29 ]
ARM7 LPC2148 STARTER KIT VSK-2148
Application
* Industrial control
* Medical systems
* Access control
* Point-of-sale
* Communication gateway
On Board Peripherals
1. ADDITION
#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
__iar_program_start
B main
SECTION .text : CODE (2)
CODE32
#include "uart.asm"
main NOP
LDR R0,=0X11111111 //Move 32 bit value to R0 Register
LDR R1,=0X12345678 //Load 2nd 32 bit value to R1 Register
ADD R8,R1,R0 //Add the two value
BL UART //output value display in a serial window, serial window
language is hex.
stop B stop //Stop the program.
END
2. SUBTRACTION
#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
__iar_program_start
B main
SECTION .text : CODE (2)
CODE32
#include "uart.asm"
main NOP
LDR R0,=0X0000FFFF //Load first 32 bit value to R0 Register
LDR R1,=0X0000EEEE //Load 2nd 32 bit value to R1 Register
SUB R8,R0,R1 //Subtract the two value
BL UART //Output value display in a serial window
stop B stop //Stop the program
END
3. MULTIPLICATION
#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
_iar_program_start
B main
SECTION .text : CODE (2)
CODE32
#include "uart.asm"
main NOP
LDR R0,=0X00000005 //Load the first 32 bit value to R0 Register
LDR R1,=0X00000005 //Load 2nd 32 bit value to R1 Register
MUL R8,R0,R1 //serial window language is hex.
BL UART //output value display in a serial window
stop B stop //Stop the program
END
4. DIVISION
#include <NXP/iolpc2148.h>
NAME main
PUBLIC __iar_program_start
SECTION .intvec : CODE (2)
CODE32
__iar_program_start
B main
LEDs:
LEDs are based on the semiconductor diode. When the diode is forward biased (switched on),
electrons are able to recombine with holes and energy is released in the form of light. This effect
is called electroluminescence and the color of the light is determined by the energy gap of the
semiconductor.
LED lighting is an emerging technology with many home applications such as LED Christmas
lights, LED rope lights, LED spotlights, etc. LED bulbs last over 50,000 hours.
VSK-2148 has 8 LEDs that are connected to the Microcontroller Port Line.
Used Port Lines : LED0 – LED7 : P1.24 – P1.31
#include<nxp/iolpc2148.H>
void delay() //Delay Routine
{
for(int i=0x00;i<=0xff;i++)
for(int j=0x00;j<=0xFf;j++);
}
void main()
{
SWITCHES
An electrical switch is any device used to interrupt the flow of electrons in a circuit. Switches are
essentially binary devices: they are either completely on ("closed") or completely off ("open").. In
the simplest case, a switch has two pieces of metal called contacts that touch to make a circuit,
and separate to break the circuit. DIP switch is one of the mostly used type.
The VSK-2148 Development Board has one 8-Way Dip Switch. When the switch is open, no
current flows through the resistor and therefore the voltage on the microcontroller pin is 3.3 V.
When the switch is closed the pin is connected directly to ground. As before, when the TTL input
is HIGH practically no current flows in the circuit and when the input is LOW there is a direct
current for the 3 A that may flow from the pin.
To Access the Dip-switch, connect 10- core cable between P13 and P14 connectors.
// SWITCH INTERFACE
// SW0 - SW7 : P0.16 - P0.23
// LED0 - LED7 : P1.24 - P1.31
// Switch Staus Displayed on LED
#include <nxp/iolpc2148.h>
static void delay(void ) //Delay Routine
{
volatile int i,j;
for (i=0;i<0x3F;i++)
for (j=0;j<500;j++);
}
void main()
{
PINSEL1 = 0x00000000; // Configured as GPIO port
PINSEL2 = 0x00000000; // Configured as GPIO port
IO0DIR = 0X00000000; // P0.16 TO P0.23 Configured as input
IO1DIR = 0Xff000000; // P1.23 TO P1.31 Configured as output
while(1)
{
IO1PIN = (~(IO0PIN & 0x00FF0000)<<0x08); //Read the switch value
}
} //And shift 8 times and then move
KEYPAD
The Matrix keyboard is used to minimize the number of I/O lines. Normally it is possible to
connect only one key or switch with a I/O line. If the number of keys in the system exceeds the
more I/O lines are required. To reduce the number of I/O lines the keys are connected in the
matrix circuit. Keyboards use a matrix with the rows and columns made up of wires. Each key act
like a switch. When a key is pressed a column wire makes contact with row wire and completes a
circuit.
For example 16 keys arranged in a matrix circuit uses only 8 I/O lines.
To Access the Dip-switch, connect 10- core cable between P13 and P12 connectors.
K8
K7
K6
K5
SW1 SW2 SW3 SW4
C D E F
1 1 1 1
2
2
K4
K3
K2
SW5 SW6 SW7 SW8
K1
8 9 A B
1 1 1 1
2
2
SW10 SW11 SW12 SW13
4 5 6 7
1 1 1 1
2
// Keypad Interface
// K1 TO K8 : P0.16 TO P0.23
// Key Value is displayed on UART0
// SCAN LINES : P0.20 TO P0.23 (OUTPUT)
// READ LINES : PO.16 TO P0.19 (INPUT)
#include<nxp/iolpc2148.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
void delay_ms()
{ //delay Routine
int i,j;
for(i=0;i<=0xff;i++)
for(j=0;j<=0xf0;j++);
}
Vi Microsystems Pvt. Ltd., [ 39 ]
ARM7 LPC2148 STARTER KIT VSK-2148
void main()
{
PINSEL0 = 0x00000005; //Pin selection for UART0
PINSEL2 = 0x00000000; //P0.16 TO P0.23 Configured as GPIO.
IO0DIR = 0X00F00005; //P0.20 TO P0.23 (O/P), P0.16 TO P0.19(I/P)
Arm_Uart0_Init(); //Serial initialization
printf("\n\r 4 x 4 Matrix Key Pad Interface ");
printf("\n\r Press any Key Pad Interface ");
while(1)
{
IO0PIN=0x00E00000; // First Scan Line
if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check if any key is pressed in //4th
row
{
if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check if any key is pressed in
//3rd row.
{
switch(IO0PIN & 0x000F0000) //check which one of the key is pressed
{
case 0x00070000 : printf("E");break;
case 0x000B0000 : printf("A");break;
case 0x000D0000 : printf("6");break;
case 0x000E0000 : printf("2");break;
}
}
IO0PIN=0x00B00000; //Move 3rd scan data to port line
if(( IO0PIN & 0x000F0000 )!= 0x0F000000)//Scan any key is pressed in 2nd row
{
switch(IO0PIN & 0x000F0000) //Check which one of the key is
//pressed in 2nd row
{
case 0x00070000 : printf("D");break;
case 0x000B0000 : printf("9");break;
case 0x000D0000 : printf("5");break;
case 0x000E0000 : printf("1");break;
}
}
IO0PIN=0x00700000; //Move 4th scan data to port line
if(( IO0PIN & 0x000F0000 )!= 0x000F0000) //Check any key is pressed in 1st
// row
{
switch(IO0PIN & 0x000F0000) //Check which one of the key is
//pressed in 1st row
{
case 0x00070000 : printf("C");break;
case 0x000B0000 : printf("8");break;
case 0x000D0000 : printf("4");break;
case 0x000E0000 : printf("0");break;
}
}
delay_ms();
}
}
Liquid crystals are a phase of matter whose order is intermediate between that of a liquid and that
of a crystal. The molecules are typically rod-shaped organic matters about 25 Angstroms in length
and their ordering is a function of temperature. The molecular orientation can be controlled with
applied electric fields. LCD is made up of two sheets of polarizing material with the liquid crystal
solution between them. An electric current passed through the liquid causes the crystals to align
so that light cannot pass through them, which results in display of character as per the applied
voltage in its data lines. The driver is provided to drive the LCD. It stores the display data
transferred from the microcontroller in the internal display RAM and generates dot matrix liquid
crystal driving signals. Each bit data of display RAM corresponds to on/off state of a dot of a liquid
crystal display.
A standard character LCD is probably the most widely used data Visualization component.
The Character LCD communicates with the microcontroller via 8 bit data bus.
The pin description for character LCD is given below.
VCC, GND AND V0 - While VCC and VSS provide +5V and ground, respectively; V0 is used for
controlling LCD contrast.
RS (Register Select) - If RS = 0, the instruction command code register is selected, allowing the
user to send a command such as clear display, cursor at home, etc.
If RS = 1, the data register is selected, allowing the user to send data to be displayed on the LCD.
RW (Read/Write) - RW allows the user to write information to the LCD or read information from
it. RW=1 when reading; RW=0 when writing.
EN (Enable) - The LCD to latch information presented to its data pins uses the enable pin. When
data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD
to latch in the data present at the data pins.
D0 – D7 - The 8-bit data pins, are used to send information to the LCD or read the contents of the
LCD’s internal registers. To display letters and numbers, we send ASCII codes for the letters A-Z,
a-z, and numbers 0-9 to these pins while making RS = 1.
RS-232 COMMUNICATION
Serial port is a serial communication physical interface through which information transfers in or
out one bit at a time (contrast parallel port). The name "serial" comes from the fact that a serial
port "serializes" data. That is, it takes a byte of data and transmits the 8 bits in the byte one at a
time. The advantage is that a serial port needs only one wire to transmit the 8 bits (while a
parallel port needs 8). The disadvantage is that it takes 8 times longer to transmit the data than it
would if there were 8 wires. Serial ports lower cable costs and make cables smaller.
There are two basic types of serial communications, synchronous and asynchronous. With
synchronous communications, the two devices initially synchronize themselves to each other,
and then continually send characters to stay in sync. Even when data is not really being sent, a
constant flow of bits allows each device to know where the other is at any given time. That is,
each character that is sent is either actual data or an idle character. Synchronous communications
allows faster data transfer rates than asynchronous methods, because additional bits to mark the
beginning and end of each data byte are not required.
Asynchronous means "no synchronization", and thus does not require sending and receiving idle
characters. However, the beginning and end of each byte of data must be identified by start and
stop bits. The start bit indicates when the data byte is about to begin and the stop bit signals when
it ends. The requirement to send these additional two bits causes asynchronous communication to
be slightly slower than synchronous however it has the advantage that the processor does not
have to deal with the additional idle characters.
An asynchronous line that is idle is identified with a value of 1 (also called a mark state). By using
this value to indicate that no data is currently being sent, the devices are able to distinguish
between an idle state and a disconnected line. When a character is about to be transmitted, a start
bit is sent. A start bit has a value of 0 (also called a space state). Thus, when the line switches from
a value of 1 to a value of 0, the receiver is alerted that a data character is about to be sent.
Data-bits
CLK
Start-bit Stop-bit
One of the LPC2148s many powerful features is its integrated UART, otherwise known as a serial
port. The fact that the LPC2148 has an integrated serial port means that you may very easily read
and write values to the serial port. If it were not for the integrated serial port, writing a byte to a
serial line would be a rather tedious process-requiring turning on and off one of the I/O lines in
rapid succession to properly "clock out" each individual bit, including start bits, stop bits, and
parity bits. However, we do not have to do this. Instead, we simply need to configure the serial
ports operation mode and baud rate. Once configured, all we have to do is write to an SFR to
write a value to the serial port or read the same SFR to read a value from the serial port.
The LPC2148 will automatically let us know when it has finished sending the character we wrote
and will also let us know whenever it has received a byte so that we can process it. We do not
have to worry about transmission at the bit level--which saves us quite a bit of coding and
processing time.
UART or Serial ports, also called communication (COM) ports, RS-232 ports are bi-directional.
The LPC2148 contain two UARTs. In addition to standard transmit and receive data lines, the
UART1 also provides a full modem control handshake interface.
Analog to Digital converter (ADC) is a device that converts continuously varying analog signals
from instruments that monitor such conditions as movement, temperature, sound, etc., into
binary code for the computer. It may be contained on a single chip or can be one circuit within a
chip. Analog to Digital conversion is the process of changing continuously varying data, such as
voltage, current, or shaft rotation, into discrete digital quantities that represent the magnitude of
the data compared to a standard or reference at the moment the conversion is made. According to
the method of conversion ADCs can be classified into Direct-Conversion ADCs, Successive
Approximation ADCs, Integrating ADC and Sigma-Delta ADCs.
The LPC 2148 has 10-bit successive approximation analog to digital converter. Basic clocking for
the A/D converters is provided by the VPB clock. A programmable divider is included in each
converter, to scale this clock to the 4.5 MHz (max) clock needed by the successive approximation
process. A fully accurate conversion requires 11 of these clocks. The ADC cell can measure the
voltage on any of the ADC input signals. Note that these analog inputs are always connected to
their pins, even if the Pin function Select register assigns them to port pins. A simple self-test of
the ADC can be done by driving these pins as port outputs.
While the ADC pins are specified as 5 V tolerant More than 3.3 V (VDDA) +10 % should not be
applied to any pin that is selected as an ADC input, or the ADC reading will be incorrect. If for
example AD0.0 and AD0.1 are used as the ADC0 inputs and voltage on AD0.0 = 4.5 V while
Vi Microsystems Pvt. Ltd., [ 49 ]
ARM7 LPC2148 STARTER KIT VSK-2148
AD0.1 = 2.5 V, an excessive voltage on the AD0.0 can cause an incorrect reading of the AD0.1,
although the AD0.1 input voltage is within the right range.
VSK-2148 has one potentiometers for working with A/D Converter. Potentiometer outputs are in
the range of 0V to 3.3V. Short the J4 jumper for reading the Potentiometer value by ADC.
// P0.28 - ADC0.1
// ADC VALUE Displayed on UART0
#include<NXP/iolpc2148.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
int putchar(int a)
{
while (!(U0LSR&0x20));
return(U0THR=a);
}
void ADC_init()
{
AD0CR_bit.SEL =1; //enable AD0.1 only
AD0CR_bit.CLKDIV = 12000000 / 4500000;
AD0CR_bit.BURST = 1; // put A/D into continuous convert mode
AD0CR_bit.CLKS = 0; //11 clocks/10 bit accuracy
AD0CR_bit.PDN = 1; //power up the unit
AD0CR_bit.START = 0x0001; //start 1st cnvrsn immediately
}
void Arm_Uart0_Init()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void main()
{
unsigned int ADCresult;
PINSEL0 = 0X00000005; // UART0 PIN SELECTION
PINSEL1 = 0x01000000; // ADC0.1 CHANNEL SELECT
Arm_Uart0_Init();
ADC_init();
while(1)
Vi Microsystems Pvt. Ltd., [ 50 ]
ARM7 LPC2148 STARTER KIT VSK-2148
{
while(AD0DR_bit.DONE == 0); //wait until conversion done
ADCresult = (AD0DR>>6)& 0x3ff ; // conversion data holds AD0DR0[6] to
AD0DR0[15]
printf("\n\r ADC VALUE ---->%x",ADCresult); //ADC value send to serial port
}
}
RELAY
A relay is an electrical switch that opens and closes under the control of an other electrical
circuit. In the original form, the switch is operated by an electromagnet to open or close one or
many sets of contacts. When a current flows through the coil, the resulting magnetic field attracts
an armature that is mechanically linked to a moving contact. The movement either makes or
breaks a connection with a fixed contact. When the current to the coil is switched off, the
armature is returned by a force approximately half as strong as the magnetic force to its relaxed
position. Usually this is a spring, but gravity is also used commonly in industrial motor starters.
Most relays are manufactured to operate quickly.
In a low voltage application, this is to reduce noise. In a high voltage or high current application,
this is to reduce arcing. If the coil is energized with DC, a diode is frequently installed across the
coil, to dissipate the energy from the collapsing magnetic field at deactivation, which would
otherwise generate a spike of voltage and might cause damage to circuit components. If the coil is
designed to be energized with AC, a small copper ring can be crimped to the end of the solenoid.
This "shading ring" creates a small out-of-phase current, which increases the minimum pull on
the armature during the AC cycle. By analogy with the functions of the original electromagnetic
device, a solid-state relay is made with a thyristor or other solid-state switching device. To
achieve electrical isolation, a light-emitting diode (LED) is used with a photo transistor.
#include <nxp/iolpc2148.h>
void delay() //delay Routine
{
unsigned int i,j;
for(i=0;i<0xff;i++)
for(j=0;j<0xff;j++);
}
int main (void)
{
PINSEL0= 0X00000000; // Pin Selection for GPIO
PINSEL1= 0X00000000; // Pin Selection for GPIO
IO0DIR = 0Xf0000000; // Pin Select for input (P0.0 to P0.29)
// Output (P0.29 to P0. 31)
while(1)
{
IO0SET = 0XA0000000; //Relay ON
delay(); // Delay
IO0CLR = 0XA0070000; //Relay OFF
delay(); //Delay
}
}
I2C PERIPHERALS
I2C Stands for Inter Integrated Circuit Communications. This module is built into many arm
Controllers. It allows I2C serial communication between two or more devices at a high speed. I2C
is a synchronous protocol that allows a master device to initiate communication with a slave
device. Data is exchanged between these devices. I2C is also Bi-Directional. This is implemented
by an “ Acknowledge” System.
I2C0CONCLR=0x8;
while(I2C0STAT!=0x28)
delay();
I2C0CONSET=0x10; //Stop the I2C Slave device
I2C0CONCLR=0x8;
delay();
I2C0CONSET=0x60; //Restart I2C
delay();
while(I2C0STAT!=0x08);
I2C0DAT=0xa1; //write slave address with READ mode
I2C0CONCLR=0x2C;
while(I2C0STAT!=0x40);
I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;
for(int i=0;i<0x03;i++)
{
I2C0CONCLR=0x08;
while(I2C0STAT!=0x50);
delay();
rtc_data[i]=I2C0DAT; //READ the RTC value & Save it to array
I2C0CONCLR = 0X0C;
I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;
}
I2C0CONSET=0x10; //Stop the I2C. slave device
I2C0CONCLR=0x8;
delay();
}
void main()
{
PINSEL0=0x00000055;
Arm_Uart0_Init();
I2C0CONCLR=0x6C; //clear I2C0CONCLR register
I2C0CONSET=0x40; //Enable I2C.
I2C0SCLH=110; //SET CLOCK VALUE
I2C0SCLL=90;
while(1)
{
delay1();
i2c_write(0x02,0X50); //WRITE FOR SECONDS
i2c_write(0x03,0X12); //WRITE FOR MINUTES
i2c_write(0x04,0X12); //WRITE FOR HOURS
while(1)
{
i2c_read(0x02); //READ RTC VALUES
printf("\n\rRTC=%x:%x:%x",rtc_data[2],rtc_data[1],rtc_data[0]);
}
} //send RTC value to serial port
}
EEPROM
#include<nxp/iolpc2148.h>
#include<stdio.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
char array[15]="ViMicrosystems";
char addr;
//FUNCTION DEFINTION
I2C0CONCLR=0x8;
delay();
//SLAVE ADDRESS
I2C0CONCLR=0x8;
while(I2C0STAT!=0x28);
delay1();
delay();
//LOW ORDER ADDRESS
//STOP CONDITION
//RESTART CONDITION
while(I2C0STAT!=0x50);
delay1();
printf("\n\r%x%x----->%c",msb_addr,lsb_addr+i,I2C0DAT);
addr=addr+1; //Send the value to serial port
I2C0CONCLR = 0X0C;
I2C0CONSET = 0X04;
I2C0CONCLR = 0X08;
}
}
int putchar(int ch)
{
while (!(U0LSR&0x20)) {}
return(U0THR=ch);
}
void UARTInit()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word
length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void main()
{
PINSEL0=0x00000055; //I2C AND UART PORT SELECTION
UARTInit();
printf("Wait for some time...");
I2C0CONCLR=0x6C;
I2C0CONSET=0x40; //Initialization for I2C slave device
I2C0SCLH=110;
I2C0SCLL=90;
for(int i=0;i<=13;i++)
i2c_write(0x00,(0x01+i),array[i]); //Write lower address, higher address and data
i2c_read(0x00,0x01,13); //read EEPROM data
while(1);
}
The seven segments are arranged as a rectangle of two vertical segments on each side with one
horizontal segment on the top and bottom. Additionally, the seventh segment bisects the
rectangle horizontally. There are also fourteen-segment displays and sixteen-segment displays (for
full alphanumeric); however, these have mostly been replaced by dot-matrix displays. Often the
seven segments are arranged in an oblique, or italic, arrangement, which aids readability.
#include<nxp/iolpc2148.h>
#include<stdio.h>
int i,temp,Temp1,addr;
temp=I2C0STAT;
while(temp!=0x08)
temp=I2C0STAT;
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x76); // Write data to segment 4
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x78); // Write data to segment 5
for(int i=0;i<=10;i++)
i2c_write(i2c_data[i],0x7A); // Write data to segment 6
}
}
BUZZER
A buzzer or beeper is a signaling device, usually electronic, typically used in automobiles and
handheld appliances. It most commonly consists of a number of switches or sensors connected to
a control unit that determines if and which button was pushed or a preset time has lapsed, and
usually illuminates a light on the appropriate button or control panel, and sounds a warning in
the form of a continuous or intermittent buzzing or beeping sound. Initially this device was based
on an electro mechanical system which was identical to an electric bell without the metal gong
(which makes the ringing noise). Often these units were anchored to a wall or ceiling and used
the ceiling or wall as a sounding board.
BUZZER: P0.15
#include<nxp/iolpc2148.h>
void delay()
{
for(int i=0;i<=0xff;i++)
for(int j=0;j<=0xff;j++);
}
void main()
{
PINSEL0 = 0X00000000; // P0.15 - GPIO PORT
IO0DIR = 0X00008000; // P0.15 - OUTPUT
while(1)
{
IO0SET = 0X00008000; // Buzzer On
delay();
IO0CLR = 0X00008000; // Buzzer off
delay();
}
}
STEPPER MOTOR
Stepper motors operate differently from normal DC motors, which simply spin when voltage is
applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed"
electromagnets arranged around a central metal gear, as shown at right. To make the motor shaft
turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted
to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet,
they are slightly offset from the next electromagnet.
So when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to
align with the next one, and from there the process is repeated. Each of those slight rotations is
called a "step." In that way, the motor can be turned a precise angle. There are two basic
arrangements for the electromagnetic coils: bipolar and unipolar.
THEORY
A step motor can be viewed as a DC motor with the number of poles (on both rotor and stator)
increased, taking care that they have no common denominator. Additionally, soft magnetic
material with many teeth on the rotor and stator cheaply multiplies the number of poles
(reluctance motor). Like an AC synchronous motor, it is ideally driven by sinusoidal current,
allowing a step less operation, but this puts some burden on the controller. When using an 8-bit
digital controller, 256 micro steps per step are possible. As a digital-to-analog converter produces
unwanted ohmic heat in the controller, pulse-width modulation is used instead to regulate the
mean current. Simpler models switch voltage only for doing a step, thus needing an extra current
limiter: for every step, they switch a single cable to the motor. Bipolar controllers can switch
between supply voltage, ground, and unconnected. Unipolar controllers can only connect or
disconnect a cable, because the voltage is already hard wired. Unipolar controllers need center
tapped windings.
It is possible to drive unipolar stepper motors with bipolar drivers. The idea is to connect the
output pins of the driver to 4 transistors. The transistor must be grounded at the emitter and the
driver pin must be connected to the base. Collector is connected to the coil wire of the motor.
Stepper motors are rated by the torque they produce. Synchronous electric motors using soft
magnetic materials (having a core) have the ability to provide position holding torque (called
detent torque, and sometimes included in the specifications) while not driven electrically. To
achieve full rated torque, the coils in a stepper motor must reach their full rated current during
each step. The voltage rating (if there is one) is almost meaningless. The motors also suffer from
EMF, which means that once the coil is turned off it starts to generate current because the motor
is still rotating. There needs to be an explicit way to handle this extra current in a circuit
otherwise it can cause damage and affect performance of the motor.
Jumper Position
#include<nxp/iolpc2148.h>
void delay_ms();
void main()
{
IO0DIR=0x000000F0; //Set port line as output port
while(1)
{
IO0PIN = 0X00000090; //0x09, 0x05, 0x06, 0x0A data are send-
delay_ms();
IO0PIN = 0X00000050; //to stepper motor. It rotates
delay_ms();
IO0PIN = 0X00000060; //the motor to forward direction
delay_ms();
IO0PIN = 0X000000A0;
delay_ms();
}
}
void delay_ms() //Delay Routine
{
int i,j;
for(i=0;i<0x0a;i++)
for(j=0;j<750;j++);
}
AC Motor
Implementing the PWM is become too easy on nowadays, because all the controllers
have build in PWM module with no of channels, so we can easily generate the PWM output
by configuring the Specified registers.
Here in our example coding we use two PWM channels (PWM2 and PWM6). Channel 6
produce the sinusoidal PWM and channel 2 gave the 180 phase shift PWM output of sinusoidal
wave.
DC Motor
TEMPERATURE SENSOR
// ADC INTERFACE
// P0.28 - ADC0.1
// Temperature Value Displayed on UART0
#include<NXP/iolpc2148.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
int putchar(int a)
{
while (!(U0LSR&0x20));
return(U0THR=a);
}
void ADC_init()
{
AD0CR_bit.SEL = 2; //enable AD0.3 only
AD0CR_bit.CLKDIV = 12000000 / 4500000;
AD0CR_bit.BURST = 1; // put A/D into continuous convert mode
AD0CR_bit.CLKS = 0; //11 clocks/10 bit accuracy
AD0CR_bit.PDN = 1; //power up the unit
AD0CR_bit.START = 0x0001; //start 1st cnvrsn immediately
}
void Arm_Uart0_Init()
{
U0LCR=0x83; / / U0LCR: UART0 Line Control Register.
// 0x83: enable Divisor Latch access, set 8-bit word length.
// 1 stop bit, no parity, disable break transmission.
VPBDIV=0x01; // VPBDIV: VPB bus clock divider 0x01:
// PCLK = processor clock.
U0DLL=DIVISOR&0xFF; // U0DLL: UART0 Divisor Latch (LSB)
U0DLM=DIVISOR>>8; // U0DLM: UART0 Divisor Latch (MSB)
U0LCR=0x03 ; // U0LCR: UART0 Line Control Register
// 0x03: disable Divisor Latch access
U0FCR=0x05 ; // U0FCR: UART0 FIFO Control Register
// 0x05: Clear Tx FIFO and enable Rx and Tx FIFOs
}
void main()
{
float ADCresult;
HARDWARE DETAILS
1. Output
2. VCC
3. Ground
TASK
OSStart();
}
2. To Study and Implement Priority Scheduling and OS Time Delay Functions by writing 3
different UART Transmitting Tasks.
#include <includes.h>
//FUNCTION DEFINITION
OSTimeDly(500);
}
}
OSTimeDly(300);
Vi Microsystems Pvt. Ltd., [ 74 ]
ARM7 LPC2148 STARTER KIT VSK-2148
}
}
OSTaskCreate(UART_Task1,0,&UART_Task1stk[99],10);
OSTaskCreate(UART_Task2,0,&UART_Task2stk[99],11);
OSTaskCreate(UART_Task3,0,&UART_Task3stk[99],12);
OSStart();
}
#include <includes.h>
extern char rtc_data[12];
//0S TASK STACK ALLOCATION
OS_STK RTC_Taskstk[1000];
OS_STK ADC_Taskstk[1000];
//FUNCTION DEFINITION
void RTC_Task(void *pdata)
{
for(;;)
{
i2c_read(0x02); //Read RTC Value
OSTimeDly(30);
}
}
void ADC_Task(void *pdata)
{
for(;;)
{
READ_ADC(); //Read ADC Value
OSTimeDly(10);
}
}
void main (void)
{
BSP_IntDisAll(); // Disable all interrupts until we are ready to accept them
BSP_Init(); //Initialize the board support package
Arm_Uart0_Init();
OSInit();
OSTaskCreate(RTC_Task,0,&RTC_Taskstk[999],0);
OSTaskCreate(ADC_Task,0,&ADC_Taskstk[999],1);
OSStart();
}
#include <includes.h>
unsigned char i2c_data[] =
{0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x67,0x77,0x7c,0x39,0x5e,0x79,0x71};
//0S TASK STACK ALLOCATION
OS_STK SEGMENT_Taskstk[1000];
OS_STK ADC_Taskstk[1000];
OS_STK PWM_Taskstk[1000];
//FUNCTION DEFINITION
void SEGMENT_Task(void *pdata)
{
for(;;)
{
i2c_write(i2c_data[KEY_READ()],0x70); //Read key value and display in 7 segment
OSTimeDly(80);
}
}
void ADC_Task(void *pdata)
{
for(;;)
{
READ_ADC(); //Read ADC value
disp(); //Plot ADC in GLCD
write_xy();
graph_ploting();
OSTimeDly(20);
}
}
void PWM_Task(void *pdata)
{
for(;;)
{
PINSEL0 |= 0X00000002; //Enable PWM2
PWMPR = 0X00000001; //Load Prescaller
PWMPCR = 0X00000200; //Pwm channel 2 Double edge control,output enable
PWMMCR= 0X00000003; //On Match with timer reset the counter
PWMMR0 = 1023; //Set cycle rate to sixteen ticcs
PWMMR1 = 512; //Ser rising edge of pwm2 to 5 ticks
PWMMR2 = 0X00000008; //Ser falling edge of pwm2 to 5 ticks
PWMLER = 0X00000007; //Enable shadow latch for match 0 -2
PWMTCR = 0X00000002; //Reset counter and Prescaller
PWMTCR = 0X00000009; //Enable counter and PWM,relese counter from reset
OSTimeDly(20);
}
}
for(int i=0;i<=0xfff;i++)
for(int i=0;i<=0xff;i++);
clear_display();
OSInit();
OSTaskCreate(SEGMENT_Task,0,&SEGMENT_Taskstk[999],0);
OSTaskCreate(ADC_Task,0,&ADC_Taskstk[999],1);
OSTaskCreate(PWM_Task,0,&PWM_Taskstk[999],2);
OSStart();
}
5. Interface a Stepper Motor and Control the Speed of Rotation by implementing RTOS delay
Functions.
#include <includes.h>
extern int speed;
//OS TASK STACK DECLARATION
OS_STK motor_Task1stk[100];
OS_STK speed_Task2stk[100];
extern int speed;
#include <nxp/ioLPC2148.h>
#include <intrinsics.h>
unsigned int FLAG,i,COUNT;
//---------------------------PLL SETTINGS---------------------------------------//
void LPC2148PLLInit(void)
{
unsigned long loop_ctr; /* Configure PLL0, which determines
the CPU clock */
PLLCFG = 0x00000024; /* Use PLL values of M = 4 and P = 2 */
PLLCON_bit.PLLE = 1; /* Set the PLL Enable bit */
PLLFEED = 0xAA; /* Write to the PLL Feed register */
PLLFEED = 0x55;
loop_ctr = 10000; /* Wait for the PLL to lock into the new
frequency */
while (((PLLSTAT_bit.PLOCK) == 0) && (loop_ctr > 0))
{
loop_ctr--;
}
PLLCON_bit.PLLC = 1; /* Connect the PLL */
PLLFEED = 0xAA; /* Write to the PLL Feed register */
PLLFEED = 0x55;
VPBDIV = 0x00000001; /* Set the VPB frequency to one-half of the CPU
clock */
}
//------------------------------------------------------------------------------//
void timer_1()
{
//Timer 1 Initialisation
T1IR = 0xFF; // reset match and capture event interrupts
T1TC = 0; // Clear timer counter
T1PR = 59; // Timer counter Increments every 0.017 usec
T1MR0 = 1000000;
T1MCR = 3; // Reset Timer Counter & Interrupt on match
}
void main(void)
{
LPC2148PLLInit();
PINSEL2 = 0X00000000; //P1.23 to P1.31 configured as GPIO.
IO1DIR = 0XFF000000; //P1.23 to P1.31 configured as output port
while(1)
{
timer_1(); // Timer 1 Initialisation
T1TCR = 1; // Run the Timer
while(T1TC!=1000000); //wait until Timer counter reaches set value
T1TCR = 0;
IO1SET = 0XFF000000; // LED is ON
T1TC=0;
timer_1();
T1TCR = 1;
while(T1TC!=1000000);
T1TCR = 0;
IO1CLR = 0XFF000000; LED is OFF
T1TC=0;
}
}
EXTERNAL INTERRUPT
#include <NXP/iolpc2148.h>
#include <intrinsics.h>
#define XTALFREQ 12000000 //XTAL frequency in Hz
#define PCLKFREQ (XTALFREQ/4) //pclk must always be XTALFREQ/4?
int main(void);
__irq __arm void IRQ_ISR_Handler (void);
void Btn2DownISR(void);
void NonVectISR(void);
void feed (void);
int main(void)
{
/* Preliminary setup of the VIC. Assign all interrupt channels to IRQ */
VICIntSelect = 0; // Set all VIC interrupts to IRQ for now
VICIntEnClear = 0xFFFFFFFF; // Diasable all interrupts
VICSoftIntClear = 0xFFFFFFFF; // Clear all software interrutps
VICProtection = 0; // VIC registers can be accessed in User or
// privileged mode
VICVectAddr = 0; // Clear interrupt
VICDefVectAddr = 0; // Clear address of the default ISR
/*Configure the pins that the buttons are hooked up to to be external
interrupts */
PINSEL1_bit.P0_30=0x2; // Set Port pin P0.15 function to EINT3
//LED Conmfiguration
PINSEL2 = 0X00000000; // P1.24 TO P1.31 as GPIO
IO1DIR = 0XFF000000; // p1.24 TO P1.31 Configured as Output port.
VICProtection = 0; // Accesss VIC in USR | PROTECT
#include<nxp/iolpc2148.h>
#include<stdio.h>
#define DESIRED_BAUDRATE 19200
#define CRYSTAL_FREQUENCY_IN_HZ 12000000
#define PCLK CRYSTAL_FREQUENCY_IN_HZ // since VPBDIV=0x01
#define DIVISOR (PCLK/(16*DESIRED_BAUDRATE))
int i,temp,Temp1,addr;
unsigned char i2c_data[] = {0x00,0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7c,0x07,0x7f,0x67}
static void delay(void )
{
volatile int i,j;
for (i=0;i<5;i++)
for (j=0;j<50;j++);
}
static void delay1(void )
{
volatile int i,j;
for (i=0;i<10;i++)
for (j=0;j<500;j++);
}
void i2c_write(char a,char add)
{
//START CONDITION
I2C0CONSET=0x60; //start I2C data transmission when set STA flag.
delay();
delay();
temp=I2C0STAT;
while(temp!=0x08)
temp=I2C0STAT;
//SLAVE ADDRESS
I2C0DAT=add;
I2C0CONCLR=0x28;
temp=I2C0STAT;
delay();
while(temp!=0x18)
{
temp=I2C0STAT;
delay();
}
//Data Write
I2C0DAT=a;
I2C0CONCLR=0x08;
temp=I2C0STAT;
while(temp!=0x28)
{
temp=I2C0STAT;//& 0x28;
delay();
}
//STOP CONDITION
I2C0CONSET=0x10;
I2C0CONCLR=0x8;
delay1();
}
int putchar(int ch)
{
while (!(U0LSR&0x20)) {}
return(U0THR=ch);
}
void main()
{
PINSEL0=0x00000055 ;
VPBDIV=0x01 ;
I2C0CONCLR=0x6C; //clear I2C0CONCLR register
I2C0CONSET=0x40; //Enable I2C.
I2C0SCLH=110;
I2C0SCLL=90;
while(1)
{
for(int i=0;i<=10;i++)
{
i2c_write(i2c_data[i],0x40);
i2c_write(i2c_data[i],0x42);
i2c_write(i2c_data[i],0x44);
i2c_write(i2c_data[i],0x46);
i2c_write(i2c_data[i],0x48);
i2c_write(i2c_data[i],0x4a);
}
}}
PWM GENERATION
#include<NXP/iolpc2148.h>
void main(void)
{
PINSEL0 = 0X00008055; // select Port pins p0.2 and p0.3 as i2c configurable and
// also to select pwm2 as output
PWMPR = 0X00000001;
PWMPCR = 0X00000400;
PWMMCR = 0X00000003;
PWMMR0 = 0X00000010;
PWMMR2 = 0X00000008;
PWMTCR = 0X00000002;
PWMTCR = 0X00000009;
while(1);
}
#include <includes.h>
#if (APP_CFG_PROBE_OS_PLUGIN_EN == DEF_ENABLED)
volatile CPU_INT32U App_ProbeCnts;
volatile CPU_BOOLEAN App_ProbeB1;
volatile CPU_BOOLEAN App_ProbeB2;
volatile CPU_INT16U App_ProbeADC;
#endif
//HEADER FILE DECLARATION
int a=10,b=20,c;
#include <includes.h>
CPU_INT08U Task1Data;
CPU_INT08U Task2Data;
OS_STK Task1stk[100];
OS_STK Task2stk[100];
OS_EVENT *mailbox;
INT8U Error;
void Task1(void *pdata);
void Task2(void *pdata);
//0S TASK STACK ALLOCATION
OS_STK UART_Task1stk[100];
OS_STK UART_Task2stk[100];
OS_STK UART_Task3stk[100];
1.Jumper Details
5 Vcc
Pin Details
1 NC
2 RxD
3 TxD
4 NC
5 GND
6 NC
7
8
9 NC
USB Connector(UP1)
Connector Type : USB B type Right Angled Connector.
Pin # Signal Name
1 +5V_USB
2 USB_D-
3 USB_D+
4 GND
CIRCUIT DIAGRAM