Lab Manual 1768
Lab Manual 1768
Lab Manual 1768
1 Lab Manual
ADT-V1
Page 1 of 84
DISCLAIMER
Embedded Lab Manual for ARM9 CORTEX and other documentation:
This manual and the accompanying documentation such as schematic diagrams in soft or hard form contains descriptions of copyrighted products, which are not explicitly indicated as such. The absence of
trademark symbol does not infer that a Product is not protected.
Additionally, registered patents and trademarks are similarly not expressly indicated in these documents.
The information in these documents has been carefully checked and is believed to be entirely reliable.
However, Advance Instruments & Services, Chennai. (henceforth Company) assumes no
responsibility for any inaccuracies. The Company neither gives any guarantee nor accepts any liability
whatsoever for consequential damages resulting from the use of these documents or associated products.
The Company reserves the right to alter the information contained herein without prior notification and
accepts no responsibility for any damages that might result. Additionally, The Company offers no
guarantee nor accepts any liability for damages arising from the improper usage or improper installation
of the hardware or software. The Company further reserves the right to alter the layout and/or design of
the hardware without prior notification and accepts no liability for doing so.
Page 2 of 84
Table Of Contents
1.Introduction...............................................................................................................................................5
2. Getting Started............................................................................................................................................ 6
2.1 Quick starts to create C language applications:.................................................................................6
2.2 Creating C applications for ADT V1.1: In Detail............................................................................. 8
3. Hardware Description...............................................................................................................................15
3.1 ADT V1.1:.......................................................................................................................................... 15
4. Connector Details, Jumper and Switch Settings...................................................................................... 15
4.1 ADT V1.1 Block Diagram:............................................................................................................... 15
4.2 DIP Switches Details:......................................................................................................................... 17
4.3 Push-Button Switches Details:........................................................................................................... 17
4.4 LEDs and Buzzer Details:.................................................................................................................. 18
4.5 Connector Details:.............................................................................................................................. 18
5. Downloading and Running User Programs..............................................................................................25
5.1 How to install Flash Magic:................................................................................................................25
5.2 Download and Run program using Flash Magic into LPC1768:...................................................... 25
6. JTAG Cable for Debugging......................................................................................................................28
6.1 Type:....................................................................................................................................................28
6.2 Contents:............................................................................................................................................. 28
6.3 Power Supply Requirements:............................................................................................................. 28
6.4 Connecting JTAG Cable:....................................................................................................................28
6.5 Verifying correct cable connection:................................................................................................... 29
6.6 How to Debug Program:.....................................................................................................................29
7. Program Downloading and related Output.............................................................................................. 30
8. RTOS And its Codes................................................................................................................................ 34
9.FPGA Programming Steps........................................................................................................................ 48
9.1 Quick starts to create VHDL language applications:....................................................................... 48
9.2 Steps for programming PROM File.................................................................................................... 52
10. FPGA and uC Interrupt performance Example......................................................................................58
10.1 Code for uC:....................................................................................................................................58
11. Experiments:........................................................................................................................................... 64
11.1 Interfacing Flashing of LEDs:........................................................................................................ 64
11.2 Interfacing Buzzer ON-OFF :.........................................................................................................64
11.3 Interfacing Digital Input and Output:.............................................................................................65
11.4 Interfacing ADC:............................................................................................................................ 66
11.5 Interfacing DAC:............................................................................................................................ 67
11.6 Interfacing LED and PWM(RGB):................................................................................................ 68
Page 3 of 84
Page 4 of 84
1. Introduction
This is users manual for ADT-V1 Trainer Kit based on LPC1768 micro-controller and XC6SLX4
Spartan6 FPGA. This trainer board is designed to perform lab practical and has a facility to download the
user programs into the on-chip flash memory of the micro-controller.
It is strongly recommended to read this manual carefully before you start using the ADT_V1 board.
CAUTION: This board contains components that are sensitive to Electro-Static Discharge (ESD). The
board must be handled carefully, so as not to subject it to ESD. As far as possible, do not touch any
conducting part on the board - including any component or connector pins - as this may damage parts of the
board permanently. If you want to touch any of the parts, make sure to discharge yourself to earth. Parts
damaged due to ESD are not covered under limited warranty.
Page 5 of 84
2. Getting Started
About Project:
What is a project?
A project is a file in which Keil uVision5 stores all information related to an application. E.g. it stores
the name of C and/or Assembler source file, memory size to be used and other options for compiler,
assembler and linker.
Opening a project:
To open an existing project file, select Project / Open Project from the menu.
Creating a new project:
To create a new project, select Project / New uVision Project from the menu.
Closing project settings:
To close the project, select Project / Close Project from the menu.
Page 7 of 84
Editor Window
Output Window
2. From Project menu, select Close project. The screen should look something like this.
Page 8 of 84
3. Then create new folder in D-drive viz. Blink (You may change name).
4. To create a new project, from Project menu, select New Project, also select folder test from Ddrive & Give file name viz. Blink & say Open
5. Then new window will displayed, here select Legacy Device Database (no RTE) in place of
Softwares Packs & search LPC1768 in search box. .
Page 9 of 84
Page 10 of 84
7. When we Say YES then Editor Window will be Empty, here we have to add our source codetext
file as given below. And Save it by appropriate name and with extension .c
You can see the .c file opened in Editor Windows . And type the code in the .c file .
Page 11 of 84
10. Then write our Source code in Editor Window & save it such as given below,
11. Now we have to configure target. For it Right Click on Target 1 folder in Project Explorer,
Go-to Output Tab, and Check Create HEX Flie and say OK.
Page 12 of 84
12. Then select Project for creating of hex file of that our project & click on Rebuild all target
files button.
Page 13 of 84
14. Our hex file will be created successfully in our destination folder.
Note: Copy following Keil CSMIS file in the folder of our project and Add Systems_LPC17xx.c
in project.
1. Systems_LPC17xx.c
2. Core_cm3.h
3. Core_cmFunc.h
4. Core_cmInstr.h
5.LPC17xx.h
6. System_LPC17xx.h
Page 14 of 84
3. Hardware Description
3.1 ADT V1.1:
Unpacking:
You will find following items in the package:
SPJ_TOOLS CD-ROM
Page 15 of 84
UART1
Zig-Bee
16 X 2 LCD
JTAG
Connector
P/S (SW1)
Section
JTAG FPGA
Programming
pins
I2C
EEPROM
and RTC
Stepper
Motor
LPC 1768
RGB LED Micro-controller
LEDs and
Switch
Array
Vccr +5V
(SW19)
FPGA Spartan
XC6SLX4
Signal Name
SW1(RST/RESET)
Reset to LPC1768
P1.18 to P1.25
SW18
P2.10/ EINT1
SW20
FPGA Interrupt
Page 17 of 84
P1.18
SW22
P1.19
SW23
P1.20
SW24
P1.21
SW25
P1.22
SW26
P1.23
SW27
P1.24
SW28
P1.25
D11
P0.4
D12
P0.5
D13
P0.6
D14
P0.7
D15
P0.8
D16
P0.9
D17
P0.10
D18
P0.11
D19
P0.26/DAC
D20
RGB LED
Buzzer
P0.26
Page 18 of 84
Signal name
Page 19 of 84
P0.20 (SCL1)
P0.19 (SDA1)
+5V
DGND
Signal name
P0.0
P0.1
P0.16
P2.3
Vcc (+5V)
GND
JTAG Connector:
This standard 20 pin JTAG connector provides debugging support for the LPC21xx. This connector is
mounted on top side of the board as shown in figure1. JTAG cables like SJT-S or SJT-U can be connected
to this connector, while other end of the cable can be connected to PC COM port or USB port, respectively.
Debugger software (like the debugger built into Keil uVision5) allows JTAG based debugging. It is also
possible to use third party JTAG based emulators /debuggers. The pin-out of JTAG Connector is given below:
Pin
Signal name
Pin
Signal name
3.3V
3.3V
NTRST
GND
TDI
GND
TMS
GND
TCK
10
GND
11
RTCK
12
GND
Page 20 of 84
TDO
14
GND
15
NRST
16
GND
17
GND
18
GND
19
GND
20
GND
SV3) :
This is 26 pin dual line headers. It brings out I/O and most of the pins of the LPC1768 microcontroller. Further, 5V and GND are also made available on these connectors. These connectors are
intended for use to connect external peripherals.
The pin/signal details of J4 are as below:
Pin
Signal No.
Pin
Signal
P0.20
14
P2.3
2
3
4
5
6
7
8
9
10
11
12
13
P0.19
P0.23
P0.24
P0.18
P2.2
P2.0
P2.1
P0.25
P0.0
P0.26
P0.16
P0.1
15
16
17
18
19
20
21
22
23
24
25
26
P0.20
P0.19
P0.23
P0.24
P0.18
P2.2
P2.0
P2.1
NA
NA
Vcc(+5V)
GND
Page 21 of 84
J5:
This is 54 pin dual line headers. It brings out I/O and most of the pins of the XC6SLX4 FPGA.
Further, 5V and GND are also made available on these connectors. These connectors are intended for use
to connect external peripherals.
The pin/signal details of IO-A are as below:
Pin
1
2
3
4
5
6
7
8
9
10
11
12
Signal No.
BUFF_P1.16
IO-A2
BUFF_P1.17
IO-A4
BUFF_P1.18
IO-A6
BUFF_P1.19
IO-A8
BUFF_P1.20
IO-A10
BUFF_P1.21
IO-A12
Pin
19
20
21
22
23
24
25
26
27
28
29
30
Signal
BUFF_P1.25
IO-A20
BUFF_P1.26
IO-A22
BUFF_P1.27
IO-A24
BUFF_P1.28
IO-A26
BUFF_P1.29
IO-A28
BUFF_P1.30
IO-A30
Page 22 of 84
Pin
37
38
39
40
41
42
43
44
45
46
47
48
Signal No.
BUFF_P0.18
IO-A38
BUFF_P0.19
IO-A40
BUFF_P0.20
IO-A42
BUFF_P0.21
IO-A44
BUFF_P0.22
IO-A46
BUFF_P1.23
IO-A48
N47
IO-A14
BUFF_P1.23
IO-A16
BUFF_P1.24
IO-A18
31
32
33
34
35
36
BUFF_P1.31
IO-A32
BUFF_P0.16
IO-A34
BUFF_P0.17
IO-A36
49
50
51
52
53
54
BUFF_P0.11
IO-A50
BUFF_P0.14
+5V
+3.3V
GND
U5:
This is 54 pin dual line headers. It brings out I/O and most of the pins of the XC6SLX4 FPGA.
Further, 5V and GND are also made available on these connectors. These connectors are intended for use
to connect external peripherals.
The pin/signal details of IO-B are as below:
Pin
1
2
3
4
5
6
7
8
9
10
Signal No.
IO-B1
IO-B2
IO-B3
IO-B4
IO-B5
IO-B6
IO-B7
IO-B8
IO-B9
IO-B10
Pin
19
20
21
22
23
24
25
26
27
28
Signal
IO-B19
IO-B20
IO-B21
IO-B22
IO-B23
IO-B24
IO-B25
IO-B26
IO-B27
IO-B28
Page 23 of 84
Pin
37
38
39
40
41
42
43
44
45
46
Signal No.
IO-B37
IO-B38
IO-B39
IO-B40
IO-B41
IO-B42
IO-B43
IO-B44
IO-B45
IO-B46
IO-B11
IO-B12
IO-B13
IO-B14
IO-B15
IO-B16
IO-B17
IO-B18
29
30
31
32
33
34
35
36
IO-B29
IO-B30
IO-B31
IO-B32
IO-B33
IO-B34
IO-B35
IO-B36
47
48
49
50
51
52
53
54
IO-B47
IO-B48
IO-B49
IO-B50
IO-B51
+5V
+3.3V
GND
5.2 Download and Run program using Flash Magic into LPC1768:
Again in Flash Magic go to Options -> Advanced Options-> Hardware Config. Use DTR and
RTS to control RST and P0.14 option should be checked. Click on OK.
Page 25 of 84
1. Connect the J1/UART0 connector of ADT V1.1 board to COM1 or COM2 of a PC, using the
serial communication cable (supplied with the board).
2. Keep S2 switch in ON position. (You can keep S2 switch continuously ON) Switch ON power to
the ADT V1.1.
3. Do proper settings in Flash Magic (COM Port: COM1 (if other choose it), Baud Rate: 19200,
Device: LPC1768, Interface: None (ISP), Enable Erase blocks used by Hex File, Browse the
file which you want to download) and click on Start button.
Page 26 of 84
4. Flash Magic will download the program. Wait till Finished comes.
5. After downloading Flash Magic automatically resets the ADT V1.1 board and program executes.
You can see output according to the program.
6. If again you want to Reset the board then press RST switch on SM-2148 board. You can see
output according to the program.
Note: Flash Magic can be used to download the program into other Philips Micro-controllers also. See
the list in Flash Magic itself
Page 27 of 84
6.2 Contents:
The JTAG Cable consists of following parts:
Cable.
The dongle consists of some electronic circuit for interfacing the JTAG port of target processor to the
host computer. The cable is a bunch of wires to connect the dongle with the JTAG port of target.
Page 28 of 84
Buzzer
Procedure
Digi IO
Page 30 of 84
External_Int
errupt
6.
1.
2.
3.
4.
I2C
EEPROM
3. Open the SPJ terminal on PC & set (com port, baud rate=
19200, stop bit=1, data bit=8, parity=none).
4. Reset the module.
5. It will display 2 option Read and Write. We have to first
select Write. Type something max of 20 character length.
Page 31 of 84
4x4 keyboard
Stepper
Motor
UART0
UART1
DAC
Xbee
Xbee_Switch
Page 33 of 84
Page 34 of 84
SWI_Handler
This change prevents the code from sitting in a loop when a SWI interrupt occurs. The change allows the
right function to run when a SWI interrupt occurs.
Copy the retarget.c file from \Keil\ARM\Startup\ to your project directory, and add it to your
project. The main purpose of this file is to avoid the use of semihosting SWIs. Thus the file must
contain the following:
Page 35 of 84
2.
If you project builds successfully, you can download it to your hardware or run it using the
Vision Simulator. You can alsodebug the application using Debug > Start Debug Session.
Page 36 of 84
Configuring RL-RTX
The RTX kernel is easy to customize for each application you create. This section describes how
you can configure the RTX kernel's features for your applications. It contains:
Configuration Options
The RTX kernel must be configured for the embedded applications you create. All configuration settings
are found in the RTX_Config.c file, which is located in
the \Keil\ARM\RL\RTX\Config directory. RTX_Config.cis configured differently for the different
ARM devices. Configuration options in RTX_Config.c allow you to:
Specify the number of concurrent running task.
Specify the number of tasks with user-provided stack
Specify the stack size for each task
Enable or disable the stack checking
Enable or disable running tasks in privileged mode
Specify the CPU timer number used as the system tick timer
Specify the input clock frequency for the selected timer
Specify the timer tick interval
Enable or disable the round-robin task switching
Specify the time slice for the round-robin task switching
Define idle task operations
Specify the number of user timers
Specify code for the user timer callback function
Specify the FIFO Queue size
Specify code for the runtime error function
There is no default configuration in the RL-RTX library. Hence, you must add
the RTX_Config.cconfiguration file to each project you create.
To customize the RTX kernel's features, you must change the configurable settings in RTX_Config.c.
Page 37 of 84
}
Note:
On some devices, the IDLE blocks debugging via the JTAG interface. Therefore JTAG debuggers
such as ULINK may not work when you are using CPU power-saving modes.
For using power-saving modes, some devices may require additional configuration (such as clock
configuration settings).
Error Function Customization
Some system error conditions can be detected during runtime. If RTX kernel detects a runtime error, it
calls the os_error() runtime error function.
void os_error (U32 err_code) {
/* This function is called when a runtime error is detected. */
OS_TID err_task;
switch (err_code) {
case OS_ERR_STK_OVF:
/* Identify the task with stack overflow. */
err_task = isr_tsk_get();
break;
case OS_ERR_FIFO_OVF:
break;
case OS_ERR_MBX_OVF:
break;
}
for (;;);
}
Page 38 of 84
Description
OS_ERR_STK_O
VF
OS_ERR_FIFO_
OVF
OS_ERR_MBX_
OVF
The runtime error function must contain an infinite loop to prevent further program execution. You can
use an emulator to step over infinite loop and trace into the code introducing a runtime error. For the
overflow errors this means you need to increase the size of the object causing an overflow.
Page 39 of 84
RTX Library version for Cortex-M devices uses SysTick timer as RTX tick timer. The SysTick
timer is Cortex-M core timer, thus common for all Cortex-M device variants. Some new dual core
devices, such as LPC4300 devices, do not implement the SysTick timer in both cores. In this case, an
alternate tick timer must be used for the core without SysTick timer.
The following functions provide an interface for an Alternate Tick Timer:
os_tick_init()
initializes hardware timer as system tick timer,
os_tick_irqack()
acknowledges hardware timer interrupt,
OS_Tick_Handler()
handles RTX tick interrupts and updates task scheduler.
Configuration
To configure an alternate peripheral timer as system tick timer, you have to:
1. implement the os_tick_init() and os_tick_irqack() functions in the RTX_Config.c configuration
file.
2. replace the alternate timer interrupt vector with the OS_Tick_Handler in the Interrupt Vector
Table in startup file.
Note:
An RTX_Blinky_RIT example, located in \Keil\ARM\Boards\MCB1700 directory, is a demo
example, configured for alternate tick timer in Cortex-M3.
Low Power RTX Configuration
The Low Power RTX extension allows using power-saving modes efficiently and building RTX
applications for power constrained devices such as battery powered devices.
The operation of the OS task scheduler in Low Power mode is different than normal operation. Instead of
executing periodic system tick interrupts when all active tasks are suspended, the system enters a powerdown mode. It calculates how long it can stay in power-down mode and disables power for peripherals
and the CPU. The wake-up timer must remain powered. The time is responsible to wake-up the system
after the power-down period expires.
The following functions provide a Low Power RTX extension:
os_suspend()
suspends OS task scheduler,
Page 40 of 84
3. Now implement the timing requirements. Since both activities must repeat indefinitely, place the
code in an endless loop in each task. After the task1 activity finishes, it must send a signal to
Page 42 of 84
4. Finally, to compile the code and link it with the RTX library, you must select the RTX operating
system for the project. From the main menu, select Project > Options for Target. Select
the Target tab. Select RTX Kernel for theOperating system. Build the project to generate the
absolute file. You can run the object file output from the linker either on your target or on the
Vision Simulato
Page 44 of 84
2. From FILE menu, select Close project (if any project is open)
Page 45 of 84
5. Now in New Project Wizard ,we have to configure Project settings. Here we have to set all
details as shown below
Page 46 of 84
7. Now in Select file type of New Source Wizard console Select the option VHDL Module, Give
appropriate Name file with the extension .vhd and Click on NEXT.
Page 47 of 84
8. Then a new window will appear, where we have to define all the required pins, direction and size for
your hardware design ( or in Entity ) and Click NEXT, then a Summary windows appears, check the pins
definition and Click FINISH.
Page 48 of 84
Page 49 of 84
4. It will start running synthesize,implement design,generate programming file. And open impact
window.
Page 50 of 84
17. Right click on console as shown below. And right click and select Initialize tool chain.
Page 51 of 84
20. After getting the Device Identify Succeeded click on Yes option for Adding SPI or PROM
Page 52 of 84
Page 53 of 84
Page 54 of 84
}
void Init_VIC_INT(void)
{
VICVectAddr0 = (unsigned long)Eint1ISR;
VICVectCntl0 = 0x20|EINT1_INT;
//bit 5 is enabled the slot to produce unique
interrupt address for enabled timer0 interrupt
VICIntEnable |= (1<<EINT1_INT); //enable timer0 interrupt
}
void Init_VIC_Timer(void)
{
VICVectAddr1 = (unsigned long)Timer0ISR;
VICVectCntl1 = 0x20|TIMER0_INT;
interrupt address for enabled timer0 interrupt
VICIntEnable |= (1<<TIMER0_INT);
}
VPBDIV = 0x01;
InitUart0();
Init_VIC_Timer();
Init_VIC_INT();
printf("Test\n");
TIMER_Init ();
InitEint1();
// Initialize Timer0
// Initialize EINT0
while(1)
{
if(toggle_mode==1)
{
Int_Count = Int_Count_Temp;
Int_Count_Temp=0;
IO1CLR |= 0x30000000;
IO1SET |= 0x02000000 ;
// Set Ack to FPGA as 1
for(p=0;p<10;p++);
byte1 = ((IO1PIN & 0x00FF0000)>>16);
IO1SET |= 0x10000000;
IO1CLR |= 0x20000000;
for(p=0;p<10;p++);
byte2 = ((IO1PIN & 0x00FF0000)>>16);
IO1SET|= 0x20000000;
IO1CLR |= 0x10000000;
for(p=0;p<10;p++);
byte3 = ((IO1PIN & 0x00FF0000)>>16);
IO1SET|= 0x30000000;
for(p=0;p<10;p++);
byte4 = ((IO1PIN & 0x00FF0000)>>16);
IO1CLR |= 0x02000000;
// Set Ack for FPGA as 0
FPGA_Count = (byte1) | (byte2 << 8) | (byte3 << 16) |(byte4 << 24) ;
printf("FPGA_Count = %d Int_Count = %d\n",FPGA_Count,Int_Count);
toggle_mode = 0;
Page 56 of 84
// Clear EINT0
Output:
1. Connect UART to PC.
2. Download hex file and after that Program the FPGA.
3. Observe the number of interrupts Scanned by uC and FPGA on serial terminal at every second.
10.2 Code for FPGA using Xilinx:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.std_logic_unsigned.all;
-- Uncomment the following library declaration if using
-- arithmetic functions with Signed or Unsigned values
--use IEEE.NUMERIC_STD.ALL;
-- Uncomment the following library declaration if instantiating
-- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity Freq_Int is
Port ( Int_in : in STD_LOGIC;
Ack : in STD_LOGIC;
addr : in STD_LOGIC_VECTOR(1 downto 0);
data : inout STD_LOGIC_VECTOR(7 downto 0);
Unused : in STD_LOGIC_VECTOR(13 downto 0);
Clk : in STD_LOGIC;
Clk_Gen : out STD_LOGIC);
Page 57 of 84
Page 59 of 84
Output on Terminal:.
Page 60 of 84
11. Experiments:
11.1 Interfacing Flashing of LEDs:
This program is available in the CD at:
ADT_TOOLS\Source_Codes\Blink:
Connections:
Keep SW19.2 switch in ON position.
8 LEDs (D11 to D18) present on ADT are connected to P0.4,P0.5,P0.6,P0.7,P0.8,P0.9,P0.10 and P0.11
respectively by Common Anode method.
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source_Codes\Blink:
To Edit / Compile/ Generate Hex file: Refer Program Downloading Procedure
Output:
You can see blinking of LEDs.
Note: Keep SW19.2 switch in OFF position to save power, after execution of program.
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source_Codes\Buzzer:
Page 62 of 84
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source_Codes\Digital_IO:
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
After pressing any switch from SW21 to SW28, its corresponding LED (D11 to D18) will become ON
otherwise it will be OFF.
Page 63 of 84
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source_Codes\ADC:
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
You can see output on Hyper Terminal.
Therefore Open Hyper Terminal. Go to Start->All Programs->Accessories->Communications>Hyper Terminal->Assign the Respective port-> Settings. Do proper settings (Baud Rate: 19200, Data
Bits: 8, Stop Bits: 1, Echo: Off, Parity: None, Com Port: Com 1 (if other choose it)). Click on OK. Go to
Port -> Open. If required Reset the ADT board. Now vary the R15 POT and hence see the change in
voltage on Hyper Terminal.
Page 64 of 84
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source\Interfacing LED with PWM(RGB):
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
You can see RED,BLUE,GREEN color blinking on RGB Led.
Note: Keep S4.3 switch in OFF position, after execution of program.
Page 65 of 84
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source\I2C RTC:
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source\I2CEEPROM:
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
You can see output on Hyper Terminal.
Therefore Open Hyper Terminal. Go to Start->All Programs->Accessories->Communications>Hyper Terminal->Assign the Respective port-> Settings. Do proper settings (Baud Rate: 19200, Data
Bits: 8, Stop Bits: 1, Echo: Off, Parity: None, Com Port: Com 1 (if other choose it)). Click on OK. Go to
Port -> Open. If required Reset the ADT board.
It will display 2 option Read and Write. We have to first select Write. Type something max of 20
character length. And reset the board and select Read option.
Page 67 of 84
Procedure:
This program is available in the CD at:
ADT_TOOLS\Source\LCD Keypad:
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
In this program after pressing any key from SW2 to SW17, its code will be displayed on 16x2 Text LCD.
Page 68 of 84
Procedure:
This program is available in the CD at:
ADT_V1.1\Source\ EINT1
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
EINT1 is configured as Low-active, Level Sensitive. Therefore if SW18 switch is pressed then D11 LED
will glow for that much of time only.
Note: Keep SW19.2 switch in OFF position, after execution of program.
Page 69 of 84
Procedure:
This program is available in the CD at:
ADT_V1.1\Source\ Stepper_Motor
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
You can see stepper motor moving in a particular direction and corresponding phase changes you can
observe on LEDs D7 to D10.
Page 70 of 84
Procedure:
This program is available in the CD at:
ADT_V1.1\Source\ ADC_Temperature
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
You can see output on Hyper Terminal.
Therefore Open Hyper Terminal. Go to Start->All Programs->Accessories->Communications>Hyper Terminal->Assign the Respective port-> Settings. Do proper settings (Baud Rate: 19200, Data
Bits: 8, Stop Bits: 1, Echo: Off, Parity: None, Com Port: Com 1 (if other choose it)). Click on OK. Go to
Port -> Open. If required Reset the ADT board.
You can see the temperature on Hyper Terminal changing if you give some heat(even rubbing the sensor
produces heat).
Page 71 of 84
Procedure:
This program is available in the CD at:
ADT_V1.1\Source\ Xigbee
To Edit / Compile/ Generate Hex file:Refer Program Downloading Procedure
To download and run this program:
Output:
You can see output on Hyper Terminal.
Therefore Open Hyper Terminal. Go to Start->All Programs->Accessories->Communications>Hyper Terminal->Assign the Respective port-> Settings. Do proper settings (Baud Rate: 19200, Data
Bits: 8, Stop Bits: 1, Echo: Off, Parity: None, Com Port: Com 1 (if other choose it)). Click on OK. Go to
Port -> Open. If required Reset the ADT board.
Press reset on both boards type some thing on keyboard of PC that respective key pressed is transmitted
from that PC to another PC using Xigbee.
Page 73 of 84
Appendix:
LPC Xpresso
1. Go to Start -> All Program -> LPCXpresso V7.8.0_426
2. Give the path for the Workspace where you want to save all the project .
Now Click on OK or if we want to change the directory of the workspace Click on Browse and
give the path.
Page 74 of 84
Page 75 of 84
5. Now for Opening new project we have to Click on File then New then Project.
6. Then, A new Pop-Up Window will appear New Project. There we have to select C/C++. In that
folder Select LPCXpresso C Project. And Click on Next.
Page 76 of 84
7. Now select the Series of our LPC micro-controller ( Like for LPC1768 we have selected LPC21) and
then select C Project and Click on Next.
Page 77 of 84
9. Now select the Micro- controller we are using in the project Click on Next
Page 78 of 84
11. Here our new project is created. Now we can see 3 files are by default present in the src folder.
12. Now open main.c file and write your code in it. And Save it.
13. Now for getting proper .HEX file as build output, Right click on Project folder -> and go to
Properties.
Page 79 of 84
Page 80 of 84
Page 81 of 84
16. Now go to Build Steps and click on Edit for Command option.
17. Then, copy the following Command in place of the default commands.
arm-none-eabi-objcopy -O ihex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex"
Page 82 of 84
Page 83 of 84
20. If after build No Error is there and .HEX file is created, then damp then .HEX file using Flash magic .
Page 84 of 84