ETT CP-JR ARM7 LPC2368 Board Microcontroller คู่มือการใช้งาน
The CP-JR ARM7 LPC2368 is a microcontroller board that uses the LPC2368, a 16/32-bit ARM7TDMI-S core from NXP. It features a rich set of peripherals, including USB, Ethernet, SD/MMC memory card, ADC, DAC, timer/counter, PWM, capture, I2C, SPI, UART, and GPIO. The board is designed to be versatile and well-suited for both learning and developing applications.
Advertisement
Advertisement
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
CP-JR ARM7 LPC2368
CP-JR ARM7 LPC2368 is ARM7TDMI-S Core Board
Microcontroller that uses 16/32-Bit 100 Pin (LQFP)
Microcontroller No.LPC2368 from Philips (NXP). All resources inside LPC2368 is quite perfect, so it is the most suitable to learn and study because if user can learn and understand the applications of all resources inside MCU well, it makes user can modify, apply and develop many excellent applications in the future. Because Hardware system of LPC2368 includes the necessary devices within only one MCU such as
USB, Ethernet, SD/MMC Memory Card, ADC, DAC,
Timer/Counter, PWM, Capture, I2C, SPI, UART, and etc.
So, ETT Team tries to find out and research the detailed information of LPC2368 and design it to be
Board Microcontroller version “CP-JR ARM7 LPC2368”.
We hope that user will buy this device to learn, modify, and develop application in the future as desired under the reasonable price. The main purpose of designing this Board CP-JR ARM7 LPC2368 is to be able to support both users who want to learn, study or try device and including person who want to really modify and develop devices. The structure of board consists of the basic components that are necessary to learn and test such as LED to display Output
Logic, Push Button Switch to test Logic Input, Volume
ETT CO.,LTD.
-1-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
to adjust voltage to test A/D, and Mini Speaker to generate various Beep sound. Moreover, it provides other devices in the high level to support the applications such as Port USB, SD/MMC Memory Card,
Port Ethernet LAN, Dot-Matrix LCD, RS232, RS232,
RS422/485. Furthermore, there is available GPIO; it makes user can design and use it with other devices as desired. So, CP-JR ARM7 LPC2368 is one of the most interesting multi-purpose boards.
Specifications of Board
1.
Use 16/32 Bit ARM7TDMI-S MCU No.LPC2368 from
Philips (NXP)
2.
Has 512KB Flash Memory and 58KB Static RAM internal MCU
3.
Use 12.00MHz Crystal, so MCU can process data with the maximum high speed at 72MHz when using it with Phase-Locked Loop (PLL) internal
MCU.
4.
Has RTC Circuit (Real Time Clock) with
32.768KHz XTAL and Battery Backup
5.
Support In-System Programming (ISP) and In-
Application Programming (IAP) through On-Chip
Boot-Loader Software via Port UART-0 (RS232)
6.
Has circuit to connect with standard 20 Pin
JTAG ARM for Real Time Debugging
7.
7-12 VAC/DC Power Supply uses Connector type as Terminal and DC-Jack with Bridge Rectifier
Circuit, +5V/800mA Regulate and +3V3/3A
Regulate
8.
Has standard 2.0 USB as Full Speed inside (USB
Function has 32 End Point)
9.
Has circuit to connect with Ethernet LAN
10/100Mb by using 1 Channel standard RJ45
Connector
10.
Has 1 Channel Circuit to connect with SD
Memory Card or MMC Memory Card
11.
Has RS232 Communication Circuit by using 2
Channel 4-PIN ETT standard Connector
12.
Has RS422/485 Serial Communication Circuit by using 1 Channel 6-PIN ETT standard Connector
ETT CO.,LTD.
-2-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
13.
Has Circuit to connect with Dot-Matrix LCD with circuit to adjust its contrast by using
14 PIN ETT standard Connector
14.
3 sets of Push Button Switch with RESET Switch
15.
Has 2 LED Circuits to display status of testing Output
16.
Has circuit to generate 0-3V3 Voltage by using an adjustable Resistor Circuit for testing A/D
17.
1 Mini Speaker to generate Beep sound
18.
Available 25 Bit GPIO for various applications such as A/D, D/A, I2C, SPI and Input/Output
•
Header 10Pin IDE (P2[0..7]) for GPIO or
Full-Duplex Serial UART
•
Header 10Pin IDE (P0[4..7],P1[20..23]) for
GPIO or 4x4 Matrix Key
•
3 Pin Header(P0[26])for GPIO or D/A
•
4 Pin Header(P0[24..25]) for GPIO or A/D
•
4 Pin Header(P0[27..28]) for GPIO or I2C Bus
•
6 Pin Header(P0[15..18] for GPIO or SPI Bus
ETT CO.,LTD.
-3-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Structure of Board CP-JR ARM7 LPC2368
Figure displays the structure of Board CP-JR ARM7
LPC2368.
ETT CO.,LTD.
-4-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
8
7 6 5
35
34
36
9
10
40
2
3
41
28
30
32
11
12
13
4
1
42
37
29
31
33
14
15
39
16
38
21
17
18 19 20
22
23
24
25
27
26
Figure displays position of devices on Board CP-JR
ARM7 LPC2368.
•
No.1 is MCU No.LPC2368 (100Pin LQFP).
•
No.2 is 12MHz Crystal to be Time Base of MCU.
•
No.3 is 32.768 KHz Crystal to be Time Base of
RTC internal MCU.
•
No.4 is 3V Battery for Backup of RTC.
•
No.5 is JTAG ARM Connector for Real Time
Debugging.
•
No.6 is GPIO (P0[4..7],P1[20..23]) Connector for
Keyboard Matrix 4x4 or GPIO.
•
No.7 is UART-0(RS232) Connector to use and
Download Hex File into CPU
•
No.8 is UART-2(RS232) Connector to use.
•
No.9 is Character LCD Connector; it can be used with +5V Supply LCD.
•
No.10 is VR to adjust the contrast or brightness of Character LCD.
ETT CO.,LTD.
-5-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
•
No.11 is USB Connector to connect with USB Hub version 2.0.
•
No.12 is LED to display status of operation and the USB connection.
•
No.13 is Jumper to select Mode of USB
Connection.
•
No.14 and No.15 is Power Supply Connector of board; it can be used with 7-12V AC/DC.
•
No.16 is LED to display status of Power +VDD
(+3V3).
•
No.17 is SW1 that is ISP LOAD or P2.10/EINT0.
•
No.18 is SW2 or RESET Switch.
•
No.19 and No.20 is SW3 and SW4 to test Logic
Input of P4[28] and P4[29].
•
No.21 and No.22 is LED to test Logic Output of
P3[25] and P3[26].
•
No.23 is VR to adjust 0-3V3 Voltage for testing
A/D (P0[23]/AD0[0]).
•
No.24 is Mini Speaker to generate various frequencies.
•
No.25 is Jumper to select Power Supply for
SD/MMC Memory Card.
•
No.26 is LED to display status of Power Supply of SD/MMC Memory Card.
•
No.27 is socket to insert Memory Card; it can be used with both SD Memory Card and MMC Memory
Card.
•
No.28 and No.29 is Jumper to select operation of
RS422/485.
•
No.30 is IC Line Driver of RS422 Receive; it can be used with 75176 or MAX3088.
•
NO.31 is IC Line Driver of RS422 Transmit and
RS485 Transceiver; it can be used with No.75176 or MAX3088.
•
No.32 and No.33 is Jumper to set Enable/Disable
Fail-Save Resistor and Terminate Resistor of
RS422 Receive, RS455 Transmit (RS485
Transceiver).
ETT CO.,LTD.
-6-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
•
No.34 is RS422/485 Connector.
•
No.35 is LED to display status of Ethernet LAN.
•
No.36 is RJ45 Ethernet LAN Connector.
•
No.37 is IC Physical Ethernet Driver No.DP83848.
•
Connector 38 is GPIO (P2[0..7] Connector for
Full-Duplex UART1 or GPIO.
•
No.39 is SPI0-Bus Connector or GPIO P0[15..18].
•
No.40 is I2C-Bus Connector or GPIO P0[27..28].
•
No.41 is A/D Connector or GPIO P0[24..25].
•
No.42 is D/A Connector or GPIO P0.26.
Applications of LED Display
LED Display circuit of Board will be connected as Sink Current type and it is used with +3.3V Power
Supply. In this case, it runs with Logic “0” (0V) and stops running with Logic “1” (+3.3V). It is controlled by 2 GPIOs that are P3[25] and P3[26].
This circuit is used to test operation of Output.
+3V3 +3V3
R53
560
R54
560
D12
P3.25
D13
P3.26
P3.25
P3.26
If we want to use this function, we must set function of P3[25] and P3[26] to be Output Port first and then control the desired Logic for P3[25] and
P3[26] as example below.
ETT CO.,LTD.
-7-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
// Config Pin GPIO = P3[26:25] Drive LED
PINSEL7 &= 0xFFC3FFFF; // Config P3[26:25] = GPIO Function
PINMODE7 &= 0xFFC3FFFF;
FIO3DIR |= 0x02000000;
// Enable Pull-Up on P3[26:25]
// Set P3[25] = Output
// Set P3[26] = Output FIO3DIR |= 0x04000000;
FIO3CLR = 0x02000000;
FIO3CLR = 0x04000000;
FIO3SET = 0x02000000;
// LED(P3[25]) = ON
// LED(P3[26]) = ON
// LED(P3[25]) = OFF
// LED(P3[26]) = OFF FIO3SET = 0x04000000;
Application of Push Button Switch
This circuit uses Push Button Switch Circuit with Pull-Up circuit; in this case, it can be used with +3.3V Power Supply. If Switch is not pressed, its status is Logic “1”; on the other hand, if Switch is pressed, its status is Logic “0”. It is used to test operation of Input Logic; moreover, this circuit has 3 sets as follows;
• SW1 (P2[10]) for ISP Download and test Input or
Interrupt(EINT0)
• SW3 (P4[28]) to test Logic Input
• SW4 (P4[29]) to test Logic Input
+3V3 +3V3
+3V3
R56
10K
R57
10K
P2.10
R1
22K
SW1
ISP LOAD
C15
100n
R3
1K
P4.28
R58
1K
SW3
P4.28
P4.29
R59
1K
SW4
P4.29
ETT CO.,LTD.
-8-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Applications of Voltage Divider (0-3V3)
The Voltage Divider Circuit uses Adjustable
Variable Resistor (VR) and it can be used with +3.3V
Power Supply. In this case, its Output is voltage in the rage of 0V to +3.3V depend on the adjusting VR.
The Output will be inputted into Pin P0[23] to generate Input voltage for testing operation of A/D
(P0[23]) circuit.
+3V3
P0.23
R55
470
P1
10K
Application of Sound Generator
Sound Generator Circuit uses Mini Speaker with
NPN Transistor circuit to drive current into speaker and can be used with +3.3V Power Supply. In this case, it runs with Logic “1” and stop running with
Logic “0”. If we want to use this function, we must send signal Logic that is various frequencies into speaker to generate various frequency ranges as desired; in this case, it is controlled by P2[8].
ETT CO.,LTD.
-9-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
+3V3
R50
10
SP1
SPEAKER
D11
LL4148
P2.8
R51
1K
R52
10K
Q3
BC817
If we want to use this function, we must configure function of P2[8] to be Output Port first and then control Logic for P2[8]ON/OFF to be the desired frequencies as example below.
// Config Pin GPIO = P2[8] Drive Mini Speaker Generate Beep
PINSEL4 &= 0xFFFCFFFF; // Config P2[8] = GPIO Function
FIO2DIR |= 0x00000100; // Config P2[8] = Output
// Loop Generate Beep on Speaker(P2.8)
// Continue
{
for (i = 0; i < 500; i++) // Start Beep Pulse
{
FIO2SET = 0x00000100;
delay(5000);
FIO2CLR = 0x00000100;
delay(5000);
}
delay(10000000);
// P2[8] = “1” (ON Speaker)
// P2[8] = “0” (OFF Speaker)
// Stop Beep Pulse
}
ETT CO.,LTD.
-10-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Application of Character LCD
The LCD Connection can be used with Character
Dot-Matrix LCD only. It connects circuit as 4 BIT
Data and signals that are connected with LCD will be signal from P1[24..29] and P1[31] about 7 Bit. The method to connect signal cable from Connector of Port
LCD to LCD Display is to use the signal name to be the reference, so we must connect all 14 signal cables according to its names as below.
The method to connect signal cable with LCD is shown as below;
• DB4 = P1[24]
• DB5 = P1[25]
• DB6 = P1[26]
• DB7 = P1[28]
• RS = P1[28]
• RW = P1[29]
• EN = P1[31]
+5V
10K
+VCC
RS
GND
VO
P1.28
P1.31
P1.25
P1.27
+5V
RS
EN
D1
D3
D5
D7
1
7
9
3
5
11
13
ET-CLCD
2
8
10
4
6
12
14
GND
VO
RW
D0
D2
D4
D6
P1.29
P1.24
P1.26
EN
D1
D3
D5
D7
RW
D0
D2
D4
D6
ET-CLCD
ETT CO.,LTD.
-11-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Application of JTAG ARM
JTAG or JTAG ARM is 20 Pin IDE Connector to interface with JTAG Debugger. Its circuit and signal is arranged under the standard of JTAG as shown below.
+3V3
TRST
TDI
TMS
TCK
RTCK
TDO
RESET
J2
1
2
3
R4
10K
R5
10K
R6
10K
R7
10K
R8
10K
R9
10K
R10
10K
R11
10K
J1
JTAG
9
11
13
15
1
3
5
7
17
19
10
12
14
16
18
20
2
4
6
8
VTref
TRST
TDI
TMS
TCK
RTCK
TDO
RES#
NC
NC
GND
GND
GND
GND
VTarget
GND
GND
GND
GND
GND
ARM JTAG Pin Connector
If connecting with JTAG to Download Code of
Debug, we must set Jumper J2(RUN/DEB) on DEB side; however, after we have already developed program, we must always set Jumper J2(RUN/DEB) on RUN side again.
Ethernet LAN
The method to connect signal between network and
Board CP-JR ARM7 LPC2368 is to use standard RJ45
Ethernet Connector. This circuit uses signal Pin
P1[0,1,4,8,9,10,14..17] for the connection; moreover, it uses Chips Physical Ethernet No.DP83848 to be
Driver.
ETT CO.,LTD.
-12-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
There are 2 methods to connect Ethernet LAN cable of board with Network; Direct Line and Through
Hub.
•
The first case; it connects with computer directly; LAN cable must be connected as Cross type.
•
The second case; it connects signal through Hub of computer Sever and its cables must be connected as Direct type.
SD/MMC Memory Card
It supports the connection with SD Memory Card and MMC Memory Card; in this part, there is LED SD to display status of Power Supply for the Memory Card.
ETT CO.,LTD.
-13-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Power Supply of Memory Card can be selected by Jumper
J26(SD/VDD); so we can select to use Power Supply either from +VDD of Board or from the control of signal Pin MCIPWR. Normally, we set Jumper
J26(SD/VDD) on SD side to use Power Supply of Memory
Card from the control of MCIPWR. All circuits to connect with Memory Card uses signal pins from MCU as follows;
• MCIDAT0 uses P0.22.
• MCIDAT1 uses P2.11.
• MCIDAT2 uses P2.12.
• MCIDAT3 uses P2.13.
• MCICMD uses P0.20.
• MCICLK uses P0.19.
• MCIPWR uses P0.21.
•
CD uses P0.8 (GPIO) to test Insert Memory
Card.
•
WP uses P0.9 (GPIO) to test the setting of
Write Protect of Memory Card.
Application of RS232
Port RS232 is signal RS232 that has been done by
MAX3232 Converter circuit completely. There are 2 channels that are UART-0 and UART-2. Both channels can be connected with signal RS232 to transmit/receive data. Moreover, UART-0 can be used to be ISP Download function to Download Hex File into
MCU; in this case, it must be used with SW1 (ISP
LOAD) and SW2 (RESET) to reset CPU to start running in Boot-Loader Mode to Download Hex File into CPU
(see more information in “Download Hex File into MCU of Board”).
UART-0(Download) UART-2
1 2 3 4 1 2 3 4
ETT CO.,LTD.
-14-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
•
UART-0 uses signal pin from P0.2(TXD0) and
P0.3(RXD0).
•
UART-2 uses signal pin from P0.10(TXD2) and
P0.11 (RXD2).
Because Hardware UART of LPC2368 can configure many points of signal Pin to connect; for example,
UART-2 can use signal Pin P0[10] and P0[11] or signal
Pin P2[8] and P2[9]. Board CP-JR ARM7 LPC2368 selects signal Pin P0[10] and P0[11] to be the connecting point with UART-2; so, we must set command to use signal Pin correctly. Be careful if we use UART because the Default value of UART-2 is disabled, so we must enable operation of UART-2 Circuit before command to Initial values for UART, otherwise we can not command UART. The example Code to configure initial values for UART is shown below.
// Config UART-0 Connect to P0[2]:P0[3]
PINSEL0 &= 0xFFFFFF0F; // Reset P0.2,P0.3 Pin Config
PINSEL0 |= 0x00000010;
PINSEL0 |= 0x00000040;
// Select P0.2 = TxD(UART-0)
// Select P0.3 = RxD(UART-0)
// Config UART-2 Connect to P0[10]:P0[11]
PINSEL0 &= 0xFF0FFFFF;
PINSEL0 |= 0x00100000;
PINSEL0 |= 0x00400000;
// Reset P0.10,P0.11 Pin Config
// Select P0.10 = TxD(UART-2)
// Select P0.11 = RxD(UART-2)
// UART2 Power-ON PCONP |= 0x01000000;
The cable that is used to connect RS232 between
Comport of computer PC and UART-0 Connector and UART-
2 Connector of Board CP-JR ARM7 LPC2368 is shown below.
ETT CO.,LTD.
-15-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
4
9
5
3
8
2
7
1
6
CD
DSR
RXD
RTS
TXD
CTS
DTR
RI
GND
RXD
TXD
GND
3
4
1
2
ET-RS232
DB9(FEMALE)
RS232-PC
23
11
24
12
25
13
20
8
21
9
22
10
18
6
19
7
3
16
4
17
5
1
14
2
15
TXD
RXD
RTS
CTS
DSR
GND
DTR
RXD
TXD
GND
3
4
1
2
ET-RS232
DB25(FEMALE)
RS232-PC
Figure displays the Cable circuit for RS232.
ETT CO.,LTD.
-16-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Application of RS422/485
For RS422/485 Communication Circuit of Board CP-
JR ARM7 LPC2368 uses UART-3 and then use signal Pin
P0[0] and P0[1] to be the connecting point. We can use this circuit to configure operation of Line
Driver Circuit to be either RS422 (Full Duplex) or
RS485 (Half-Duplex).
If it is RS422, it can transmit and receive data simultaneously as bidirectional as
RS232 but this function is longer distance. On the other hand, if it is RS485, we can configure its format of communication to be either Half-Duplex or
Full Duplex; in this case, if it is RS485 (Full-
Duplex), it is similar to RS422 but we must control
ON/OFF circuit of the transmitter; on the other hand, if it is RS485 (Half-Duplex), it will alternate function between receiver and transmitter by using signal P1[19] to be Output Port function for setting the direction of data.
If status of P1[19] is Logic
“1”, it configures the direction of data to be transmitter but if status of P1[19] is Logic “0”, it configures the direction of data to be receiver. The
IC Line Driver of circuit can select either No.75176 or MAX3088; if using 75176, the maximum point that can be connected signal of RS485 as Multi-Drop type is 32 points; but if using MAX3088, the maximum point that can be connected as Multi-Drop type is 256 points. The connector of RS422/485 is CPA-6 Connector that has arranged as shown below.
RS422/485
1 2 3 4 5 6
Figure displays position of signal Pin when using it to be RS422.
ETT CO.,LTD.
-17-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
RS422/485
1 2 3 4 5 6
Figure displays position of signal Pin when using it to be RS485 (Full-Duplex).
RS422/485
1 2 3 4 5 6
Figure displays position of signal Pin when using it to be RS485 (Half-Duplex).
ETT CO.,LTD.
-18-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
+5V
J16
3
2
1
RH
J15
RL
3
2
1
J17
3
2
1
RZ
C42
+5V
R60
1K
R61
1K
R62
120
1
2
3
4
U6
75176
R
RE
DE
D
VCC
B
A
GND
100n
8
7
6
5
+5V
FULL/HALF
J19
C43
+5V
100n
RX-
RX+
TX-
TX+
J18
RS422/485
3
4
1
2
5
6
RXD3
+5V
422/485
J20
3
4
1
2
U7
75176
R
RE
DE
D
VCC
B
A
GND
6
5
8
7
P1[19]
TXD3
R63
1K
R64
1K
R65
120
J21
TH
1
2
3
+5V
J22
1
2
3
TL
J23
1
2
3
TZ
Figure displays circuit of RS422/485.
If we want to use it to be RS422, we must install 2 IC Line Driver Circuits and set Jumper J19 and J20 to be RS422 (Full Duplex) as follow; set
Jumper J19 (FULL/HALF) on FULL side and then set
Jumper J20 (422/485) on 422 side.
If using RS485 (Full Duplex), we must install 2
IC Line Driver as same as RS422; but in this case, we must set Jumper J19 and J20 to be RS485 (Full Duplex) as follows; set Jumper J19 (FULL/HALF) on FULL side and then set Jumper J20 (422/485) on 485 side. The
ETT CO.,LTD.
-19-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
operation is similar to RS422 because it can simultaneously transmit and receive data as bidirectional type like RS422 but it can be connected as Multi-Drop type. The circuit can receive data all the time through IC Line Driver of U6 and IC Line
Driver U7 will transmit data.
In this case, it can control ON/OFF operation of transmitting data by signal from P1[19]; if status of P1[19] is Logic “1”, it enables operation of transmitting data but if status of P1[19] is Logic “0”, it disables operation of transmitting data. When the operation of transmitting data is disabled, its status is similar to removing cable of the transmitter from circuit, so signal on the transmitter does not crash data of other devices. We must write program to control all devices to transmit only one data into a line once.
If using RS485 (Half-Duplex), we must install only one IC Line Driver at position U7; in this case, we must set Jumper J19 and J20 to be RS485 (Half
Duplex) as follows; set Jumper J19 (FULL/HALF) on
HALF side and then set Jumper J20 (422/485) on 485 side. Moreover, we must interface cable of CPA-6(J18)
Connector at the position TX(-) and TX(+); in this case, function of TX(-) is RS485(-) and function of
TX(+) is RS485(+). Direction and function of this signal RS485 depends on status Logic of P1[19] that is Pin Output Port and its function is Direction
Control.
The method to set Jumper of Fail-Save Resistor and Terminate Resistor is describes as follows; if
Board is generally installed in the beginning position and destination of these Jumper Cables, we must enable and then set Jumper(EN/DIS) of RZ, RL,
RH, TZ, TL and TH on EN side or always Enable. The
Fail-Safe Resistor (RL, RH, TL and TH) makes status
Logic in the signal cable is in the correct IDLE status while not receiving and transmitting any data.
For the Terminate Resistor (RZ and TZ) will compensate the resistance or Impedance that is occurred in the line if it is very long line.
Code for writing program to configure operation of UART-3 of RS422/485, we must use P0[0] and P0[1]
ETT CO.,LTD.
-20-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
to be the connecting Pin and then use P1[19] to control the direction of receiving and transmitting data of RS485. Be careful, the Default value of the
UART-3 Circuit in LPC2368 is normally disabled; so, if we want to enable operation of this circuit, we must not forget to write command to enable operation of UART-3 before setting configurations into circuit.
The method to enable operation of UART-3 is to be controlled by Bit in Register PCONP as example below.
// Config UART-3(RS422/485) Connect to P0[0]:P0[1]
PINSEL0 &= 0xFFFFFFF0; // Reset P0.0,P0.1 Pin Config
PINSEL0 |= 0x00000002;
PINSEL0 |= 0x00000008;
PCONP |= 0x02000000;
// Select P0.0 = TxD(UART3)
// Select P0.1 = RxD(UART3)
// UART3 Power-ON
// Config P1.19 = Output Control Direction RS485
// P1.19 = "0" = Received RS485
// P1.19 = "1" = Transmit RS485
PINSEL3 &= 0xFFFF3FFF;
IODIR1 = 0x00080000;
IOCLR1 = 0x00080000;
// P1.19 = GPIO
// Pin Control Direction RS485 = Output
// Select Direction RS485 = Receive
// RS485 Direction = 0 (Receive)
// Select Direction RS485 = Transmit
IOSET1 = 0x00080000; // RS485 Direction = 1 (Transmit)
Port I/O Connectors of Board
For Port I/O Connector of CPU is arranged outwards, so it makes user be able to connect as desired; in this case, there are 6 sets as follows;
• 2 Sets of IDE 10 Pin Connector; each set has 8
Bit that is P2[0..7] and KEY4X4
(P0[4..7],P1[20..23]). Its signal arrangement is shown below.
ETT CO.,LTD.
-21-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
P2.0
P2.2
P2.4
P2.6
+3V3
P2.1
P2.3
P2.5
P2.7
GND
P0.4
P0.6
P1.20
P1.22
+3V3
P0.5
P0.7
P1.21
P1.23
GND
P2[0..7] P0[4..7],P1[20..23]
• SPI-0 Connector is 1x6 Header that is connecting point P0[15..18] for using it to be general GPIO function or SPI Bus function as desired. o
P0.15 = SCK/SCK0 o
P0.16 = SSEL/SSEL0 o
P0.17 = MISO/MISO0 o
P0.18 = MOSI/MOSI0
• I2C-0 Connector is 1x4 Header that is connecting point P0[27..28] for using it to be general GPIO function or I2C Bus function as desired. o
P0.27 = SDA0 o
P0.28 = SCL0
•
A/D Connector is 1x4 Header that is connecting point P0[24..25] for using it to be general GPIO function or A/D function as desired.
o
P0.24 = AD0.1 o
P0.25 = AD0.2
•
D/A Connector is 1x3 Header that is connecting point P0[26] for using it to be general GPIO function or D/A(Aout) function as desired.
o
P0.26 = AOUT or D/A
Power Supply Circuit
Power Supply Circuit can be used with 7-12V
AC/DC; in this case, we can interface Power Supply into board at the connecting point that is Terminal or Jack-DC as desired. This connecting Power Supply
ETT CO.,LTD.
-22-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
will be sent to Bridge Rectifier Circuit and +3V3/3V
Regulate and +5V/800mA Regulate.
Power Supply Circuit in the part of 3.3V
Regulate Circuit will supply power into CPU and all
I/O Circuit of Board, except Character LCD and Line
Driver Circuit of RS422/485 because both devices use
+5VDC Power Supply from Regulate Circuit.
J12
1
2
3
U3
LD1085
IN OUT
2
C29
470uF/16V
+
+3V3
R49
560
C30
100n
D9
PWR
J13
3
2
1
D10
BRIDGE
7-12Vdc
C31
220uF/25V
+
C32
100n
3
U4
AP1117-5.0
IN OUT
2
C33
100uF/16V
+
+5V
C34
100n
How to Download Hex File into MCU of Board
The method to download Hex File into Flash
Memory of MCU in Board is to use Program Flash Magic of
“Embedded System Academy,Inc” that is connected with MCU through Serial Port of computer PC. This program can be downloaded free without any charge from website www.esacademy.com
.
Proceeding to Download Hex File into MCU
1.
Interface RS232 Cable between RS232 Serial Port of PC and Board UART-0.
2.
Supply power into board; in this case, we can see red LED PWR is in status ON.
3.
Run Program Flash Magic; if it is version
4.02.260, it will display result as shown below.
ETT CO.,LTD.
-23-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
4.
Start setting the initial values into program as desired; in this case, it is used with LPC2368 of Board CP-JR ARM7 LPC2368 of ETT, so we configure values into program as follows;
2.1
2.2
Select COM port corresponding with the
COM Port Number that is used (in the example, it is COM2).
Set Baud Rate in the range 2400-115200; if setting very high Baud Rate and
Error is occurred, please reduce Baud
Rate. In this example, it uses Baud
2.3
2.4
2.5
Rate 19200.
Set Device to be LPC2368.
Set Interface to be None ISP.
Set Crystal Oscillator with MHz corresponding with the value internal
ETT CO.,LTD.
-24-
WWW.ETT.CO.TH
User’s Manual of Board Microcontroller CP-JR ARM7 LPC2368
Board. In this case, it is 12.000MHz,
2.6
so we must set to be 12.
Press ISP LOAD Switch and RESET Switch on Board “CP-JR ARM7 LPC2368” to reset
MCU to run in Boot Loader following the processes;
Press ISP LOAD Switch and hold
Press RESET Switch while ISP LOAD
Switch is being held.
Remove RESET Switch but ISP LOAD
Switch is being held.
Lastly, remove ISP LOAD Switch.
5.
Select format of erasing data to be “Erase all
Flash + Code Rd Prot”.
6.
Set Option to be “Verify after programming”.
7.
Click “Browse” to select HEX File for downloading.
8.
Click “Start”, Program Flash Magic will start downloading data into MCU instantly. In this case, we can see the status operation at Status
Bar and we must wait for the operation until it is completely.
9.
When the operation of program is complete, press
RESET Switch on Board and MCU will start running follow the downloaded program instantly.
ETT CO.,LTD.
-25-
WWW.ETT.CO.TH
D
C
B
A
1
+3V3
ENET-TXD0
ENET-TXD1
ENET-TX_EN
ENET-CRS
ENET-RXD0
ENET-RXD1
ENET-RX_ER
ENET-RX_CLK
ENET-MDC
ENET-MDIO
P1.20
USB_LED
DIR_485
P1.21
P1.22
P1.23
LCD_DB4
LCD_DB5
LCD_DB6
LCD_DB7
LCD_RS
LCD_RW
USB_VBUS
LCD_EN
P3.25
P3.26
P4.28
P4.29
L1
BEAD
+
C1
10u
C2
100n
C3
100n
+3V3
+3V3
C4
100n
C5
100n
C6
100n
10
12
13
42
84
28
54
71
96
35
36
37
87
86
32
33
34
91
90
89
88
95
94
93
92
44
45
21
20
38
39
40
43
27
26
82
85
+3V3
PMEG4005ET
D1
B1
3V
D2
PMEG4005ET
1
C7
100n
C8
100n
C9
100n
C10
100n
19
72
97
83
11
15
31
41
55
2
VBAT
VSS1
VSS2
VSS3
VSS4
VSS5
VSS6
VSS7
VSSA
U1
LPC2368
P1.0/ENET-TXD0
P1.1/ENET-TXD1
P1.4/ENET-TX_EN
P1.8/ENET-CRS
P1.9/ENET-RXD0
P1.10/ENET-RXD1
P1.14/ENET-RX_ER
P1.15/ENET-RX_CLK
P0.0/RD1/TXD3/SDA1
P0.1/TD1/RXD3/SCL1
P0.2/TXD0
P0.3/RXD0
P0.4/I2SRX_CLK/RD2/CAP2.0
P0.5/I2SRX_WS/TD2/CAP2.1
P0.6/I2SRX_SDA/SSEL1/MAT2.0
P0.7/I2STX_CLK/SCK1/MAT2.1
P1.16/ENET-MDC
P1.17/ENET-MDIO
P1.18/USB_UP_LED/PWM1.1/CAP1.0
P1.19/CAP1.1
P1.20/PWM1.2/SCK0
P1.21/PWM1.3/SSEL0
P1.22/MAT1.0
P1.23/PWM1.4/MISO0
P0.8/I2STX_WS/MISO1/MAT2.2
P0.9/I2STX_SDA/MOSI1/MAT2.3
P0.10/TXD2/SDA2/MAT3.0
P0.11/RXD2/SCL2//MAT3.1
P0.15/TXD1/SCK0/SCK
P1.24/PWM1.5/MOSI0
P1.25/MAT1.1
P1.26/PWM1.6/CAP0.0
P1.27/CAP0.1
P1.28/PCAP1.0/MAT0.0
P1.29/PCAP1.1/MAT0.1
P1.30/USB_VBUS/AD0.4
P1.31/SCK1/AD0.5
P0.16/RXD1/SSEL0/SSEL
P0.17/CTS1/MISO0/MISO
P0.18/DCD1/MOSI0/MOSI
P0.19/DSR1/MCICLK/SDA1
P0.20/DTR1/MCICMD/SCL1
P0.21/RI1/MCIPWR/RD1
P0.22/RTS1/MCIDAT0/TDI
P0.23/AD0.0/I2SRX_CLK/CAP3.0
P3.25/MAT0.0/PWM1.2
P3.26/MAT0.1/PWM1.3
P4.28/MAT2.0/TXD3
P4.29/MAT2.1/RXD3
P0.24/AD0.1/I2SRX_WS/CAP3.1
P0.25/AD0.2/I2SRX_SDA/TXD3
P0.26/AD0.3/AOUT/RXD3
P0.27/SDA0
P0.28/SCL0
P0.29/USB_D+
P0.30/USB_D-
VDDA
VREFA
DC-DC_3.3V_VDD1
DC-DC_3.3V_VDD2
DC-DC_3.3V_VDD3
P2.0/PWM1.1/TXD1/TRACECLK
P2.1/PWM1.2/RXD1/PIPESTAT0
P2.2/PWM1.3/CTS1/PIPESTAT1
P2.3/PWM1.4/DCD1/PIPESTAT2
P2.4/PWM1.5/DSR1/TRACESYNC
P2.5/PWM1.6/DTR1/TRACEPKT0
P2.6/PCAP1.0/RI1/TRACEPKT1
P2.7/RD2/RTS1/TRACEPKT2
VDD1
VDD2
VDD3
VDD4
P2.8/TD2/TXD2/TRACEPKT3
P2.9/USB_CONNECT/RXD2/EXTINT0
P2.10/EINT0
P2.11/EINT1/MCIDAT1/I2STX_CLK
P2.12/EINT2/MCIDAT2/I2STX_WS
P2.13/EINT3/MCIDAT3/I2STX_SDA
TRST
TDI
TMS
TCK
RTCK
TDO
RSTOUT
RESET
RTCX1
RTCX2
Y1
C13
22pF
65
64
53
52
51
50
69
68
67
66
75
74
73
70
24
29
30
8
7
6
25
58
57
56
9
63
61
60
59
16
18
4
1
14
17
2
3
5
100
81
80
79
78
46
47
98
99
77
76
48
49
62
TXD3
RXD3
TXD0
RXD0
CD
WP
TXD2
RXD2
MCICLK
MCICMD
MCIPWR
MCIDAT0
P0.23
P0.24
P0.25
P0.26
P0.27
P0.28
USB_D+
USB_D-
P2.0
P2.1
P2.2
P2.3
P2.4
P2.5
P2.6
P2.7
P0.4
P0.5
P0.6
P0.7
P0.15
P0.16
P0.17
P0.18
3
P2.8
USB_CON
ISP_BOOT
MCIDAT1
MCIDAT2
MCIDAT3
TRST
TDI
TMS
TCK
RTCK
TDO
RESET
RESET
Y2
32.768KHz
C14
22pF
ISP_BOOT
RESET
+3V3
22K
+3V3
R1
Title
SW1
ISP LOAD
C15
100n
R2
47K
SW2
RESET
C16
100n
C11
22pF
2
12MHz
C12
22pF
3
Size
A4
Date:
File:
R3
1K
TRST
TDI
TMS
TCK
RTCK
TDO
RESET
J2
1
2
3
+3V3
P0.15
P0.16
P0.17
P0.18
+3V3
P0.27
P0.28
+3V3
P0.24
P0.25
J5
3
4
1
2
I2C-0
J7
3
4
1
2
A/D
J3
3
4
1
2
5
6
SPI-0
P2.0
P2.2
P2.4
P2.6
+3V3
4
+3V3
R4
10K
R5
10K
R6
10K
R7
10K
R8
10K
R9
10K
R10
10K
R11
10K
P0.4
P0.6
P1.20
P1.22
+3V3
J1
JTAG
5
7
1
3
9
11
13
15
17
19
J4
P2.0-P2.7
5
7
1
3
9
6
8
2
4
10
J6
KEY4X4
5
7
1
3
9
6
8
2
4
10
+3V3
P0.26
J8
1
2
3
D/A
CP-JR ARM7 LPC2368
Number
ETT CO.,LTD.(WWW.ETT.CO.TH)
31-Jan-2008
D:\My Circuit\LPC2368.Ddb
1
Drawn By:
4
4
Revision
1.0
10
12
6
8
2
4
14
16
18
20
P2.1
P2.3
P2.5
P2.7
P0.5
P0.7
P1.21
P1.23
D
C
B
A
1 2 3 4
D
B
A
1
C17
+3V3
4
R12
10K
+3.3V
E/D
100n
2
GND
OSC1
50MHz
OUT
1
3
+3V3
C +3V3
ENET-CRS
ENET-RX_ER
ENET-RXD0
ENET-RXD1
2K2
PFBOUT
C18
100n
R16
+3V3
C22
100n
41
42
43
44
37
38
39
40
45
46
47
48
PFBIN2
RX_CLK
RX_DV/MII_MODE
CRS/CRS_DV/LED_CFG
RX_ER/MDIX_EN
COL/PHYAD0
RXD_0/PHYAD1
RXD_1/PHYAD2
RXD_2/PHYAD3
RXD_3/PHYAD4
IOGND
IOVDD33
D3
R13
2K2
R14
680
100Mb
+3V3
ENET-RX_CLK
R15
4K87 1%
U2
DP83848
C19
100n
RBIAS
PFBOUT
AVDD33
NC
NC
AGND
PFBIN1
TD+
TD-
AGND
RD+
RD-
20
19
18
17
16
15
14
13
24
23
22
21
PFBOUT
C20
10u
C21 100n
+3V3
R17
2K2
R18
2K2
R23
10K
2
+3V3
R19
50
+3V3
R20
50
C23
100n
+3V3
C24
100n
R21
50
R22
50
+3V3
C25
100n
+3V3
C26
100n
D4
LED_LINK
LED_ACT
LINK
D5
3
ACT
2
3
1
4
5
6
J9
RJ45_PRJ-005
TD+
CT
TD-
RD+
CT
1CT:1
RD-
NC
TX+
TX-
1
2
RX+
3
CHS GND
RX-
6
4
5
7
8
R24
+3V3
2K2
R25
110
R26
2K2
R27
110
Title
Size
A4
Date:
File:
CP-JR ARM7 LPC2368
Number
ETT CO.,LTD.(WWW.ETT.CO.TH)
31-Jan-2008
D:\My Circuit\LPC2368.Ddb
2
Drawn By:
4
4
Revision
1.0
D
C
B
A
D
1
+3V3
R28
R29
R30
R31
R32
R33
R34
10K
10K
10K
10K
10K
10K
10K
RS
EN
RW
D4
D5
D6
D7
R28-R34=NA
LCD_RS
LCD_EN
LCD_DB5
LCD_DB7
+5V
P2
10K
Contrast
+5V
RS
EN
D1
D3
D5
D7
J10
1
3
5
7
9
11
13
ET-CLCD (5V)
10
12
6
8
14
2
4
GND
VO
RW
D0
D2
D4
D6
LCD_RW
LCD_DB4
LCD_DB6
2
C
R66,R67 = NA
+3V3
MCIPWR
R38
22K
R37
3K3
R66
3K3
P
3
2
1
N
Q1
FDC6327
3
4
5
6
C27
10u
+
C28
100n
R67
0
SD/VDD
2 3
J26
CD
WP
+3V3
MCIDAT2
MCIDAT3
MCICMD
R39
560
MCICLK
MCIDAT0
MCIDAT1
D6
SD
R35
10K
+3V3
CD
9
1
2
5
6
3
4
7
8
WP
R36
10K
DAT2
CD/DAT3
CMD
VSS
VDD
CLK
VSS
DAT0
DAT1
4
CN1
SD-CARD
B
J12
1
2
J13
7-12Vdc
3
2
1
A
1
3
U3
LD1085
IN OUT
2
C29
470uF/16V
+
+3V3
R49
560
C30
100n
D10
BRIDGE
C31
220uF/25V
+
C32
100n
3
U4
AP1117-5.0
IN OUT
2
C33
100uF/16V
+
+5V
C34
100n
D9
PWR
2 3
D7
UGL
USB_LED
USB_CON
J11
1
2
3
UMODE
R42
2K2
R40
560
+3V3
R41
10K
+5V-USB
Q2
BC807
R45
1K5
R46
560
USB_VBUS
R43
2K2
R44
3K3
USB_D-
USB_D+
D8
USC
+5V-USB
J14
D-
D+ 3
4
1
2
USB PORT_B
C35
18pF
C36
18pF
R47
33
R48
33
Title
Size
A4
Date:
File:
CP-JR ARM7 LPC2368
Number
ETT CO.,LTD.(WWW.ETT.CO.TH)
31-Jan-2008
D:\My Circuit\LPC2368.Ddb
3
Drawn By:
4
4
Revision
1.0
D
C
B
A
D
C
B
A
1 2 3 4
+3V3
R50
10
D11
LL4148
SP1
SPEAKER
P2.8
R51
1K
R52
10K
Q3
BC817
1
P4.28
1
U5
C1+ VCC
C38
100n
RXD2
TXD2
RXD0
TXD0
3
4
C1-
C2+
V+
V-
C40
100n
5
12
11
9
10
C2-
R1O
T1I
R2O
T2I
ICL3232
GND
R1I
T1O
R2I
T2O
15
8
7
13
14
+3V3
C37
100n
16
C39
100n
2
6
C41
100n
P3.25
+3V3
R53
560
D12
P3.25
+3V3
RXD-2
TXD-2
J24
UART-2
3
4
1
2
+3V3
RXD-0
TXD-0
J25
DOWNLOAD
3
4
1
2
2
P3.26
+3V3
R54
560
D13
P3.26
+3V3
R58
1K
R56
10K
SW3
P4.28
P4.29
R59
1K
+3V3
R57
10K
SW4
P4.29
RXD3
DIR_485
TXD3
+3V3
P0.23
R55
470
FULL/HALF
1 2
J19
+5V
422/485
1 2
J20
P1
10K
3
4
1
2
U6
75176
R
RE
DE
D
3
4
1
2
U7
75176
R
RE
DE
D
+5V
J16
3
2
1
RH
J15
RL
3
2
1
C42
+5V
R60
1K
R61
1K
VCC
B
A
GND
100n
8
7
6
5
C43
+5V
VCC
B
A
GND
100n
8
7
6
5
J17
3
2
1
RZ
R62
120
+5V
RX-
RX+
TX-
TX+
J18
RS422/485
3
4
1
2
5
6
3
J21
TH
1
2
3
+5V
R63
1K
R64
1K
J22
1
2
3
TL
R65
120
J23
1
2
3
TZ
Title
Size
A4
Date:
File:
CP-JR ARM7 LPC2368
Number
ETT CO.,LTD.(WWW.ETT.CO.TH)
31-Jan-2008
D:\My Circuit\LPC2368.Ddb
4
Drawn By:
4
4
Revision
1.0
D
C
B
A
Advertisement
Key Features
- 16/32-bit ARM7TDMI-S core
- 512KB Flash Memory
- 58KB Static RAM
- USB 2.0 Full Speed
- Ethernet LAN 10/100Mb
- SD/MMC Memory Card
- RS232 Communication Circuit
- RS422/485 Serial Communication Circuit
- Dot-Matrix LCD
- GPIO for various applications