Sie sind auf Seite 1von 30

Users 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

Users 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
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 InApplication 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 1.

ETT CO.,LTD.

-2-

WWW.ETT.CO.TH

Users 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

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368

Structure of Board CP-JR ARM7 LPC2368

Figure displays LPC2368.

the

structure

of

Board

CP-JR

ARM7

ETT CO.,LTD.

-4-

WWW.ETT.CO.TH

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368

5 36

35 28

34

10 12 11 13

40
2 1

41 42 37

30 31 29

32 33

4 39 16 21 17 18 19 20 38 22 23 24

14 15

27 26

25

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
Debugging. Keyboard Matrix 4x4 or GPIO.

Time

No.6 is GPIO (P0[4..7],P1[20..23]) Connector for No.7


is UART-0(RS232) Connector Download Hex File into CPU to use and

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

Users 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 Connection.

to

select

Mode

of

USB

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 frequencies.

Speaker

to

generate

various

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 RS422 Receive, Transceiver). and Terminate Resistor of RS455 Transmit (RS485

ETT CO.,LTD.

-6-

WWW.ETT.CO.TH

Users 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] Full-Duplex UART1 or GPIO. Connector for

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 P3.25 P3.26

D13 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

Users 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; // Enable Pull-Up on P3[26:25] FIO3DIR |= 0x02000000; // Set P3[25] = Output FIO3DIR |= 0x04000000; // Set P3[26] = Output FIO3CLR FIO3CLR FIO3SET FIO3SET = 0x02000000; = 0x04000000; = 0x02000000; = 0x04000000; // LED(P3[25]) = ON // LED(P3[26]) = ON // LED(P3[25]) = OFF // LED(P3[26]) = OFF

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

R1 22K SW1 P2.10 ISP LOAD C15 100n R3 1K P4.28

R56 10K R58 P4.29 1K SW3 P4.28 1K R59

R57 10K

SW4 P4.29

ETT CO.,LTD.

-8-

WWW.ETT.CO.TH

Users 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

R55 P0.23 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

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368

+3V3

R50 10 SP1 SPEAKER

D11 LL4148

R51 P2.8 1K R52 10K

Q3 BC 817

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) while(1) // { for (i = 0; i < 500; i++) // { FIO2SET = 0x00000100; // delay(5000); FIO2CLR = 0x00000100; // delay(5000); } delay(10000000); }

Loop Continue Start Beep Pulse P2[8] = 1 (ON Speaker)

P2[8] = 0 (OFF Speaker)

// Stop Beep Pulse

ETT CO.,LTD.

-10-

WWW.ETT.CO.TH

Users 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 DB5 DB6 DB7 RS RW EN = = = = = = = P1[24] P1[25] P1[26] P1[28] P1[28] P1[29] P1[31]

+5V 10K

+VCC RS
+5V RS EN D1 D3 D5 D7 1 3 5 7 9 11 13 ET-CLC D 2 4 6 8 10 12 14 GND VO RW D0 D2 D4 D6

GND VO RW D0 D2 D4 D6 ET-CLCD

P1.28 P1.31 P1.25 P1.27

EN D1
P1.29 P1.24 P1.26

D3 D5 D7

ETT CO.,LTD.

-11-

WWW.ETT.CO.TH

Users 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

R4 R5 R6 R7 10K 10K 10K 10K

J1 JTAG 1 3 5 7 9 11 13 15 17 19 2 4 6 8 10 12 14 16 18 20

VTref TRST TDI TMS TCK RTCK TDO RES#

VTarget GND GND GND GND GND GND GND GND GND

TR ST TDI TM S TC K RTCK TDO RESET J2 1 2 3 RUN/DEBUG

R8 R9 R10 R11 10K 10K 10K 10K

NC NC

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

Users 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 connected as Direct type. its cables must be

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

Users 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. Card.

CD uses P0.8 (GPIO) to test Insert Memory 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)
1 2 3 4 1

UART-2
2 3 4

RXD0

RXD2

TXD0

TXD2

+3V3

+3V3

GND

ETT CO.,LTD.

GND

-14-

WWW.ETT.CO.TH

Users 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; // Select P0.2 = TxD(UART-0) PINSEL0 |= 0x00000040; // Select P0.3 = RxD(UART-0) // Config UART-2 Connect to P0[10]:P0[11] PINSEL0 &= 0xFF0FFFFF; // Reset P0.10,P0.11 Pin Config PINSEL0 |= 0x00100000; // Select P0.10 = TxD(UART-2) PINSEL0 |= 0x00400000; // Select P0.11 = RxD(UART-2) PCONP |= 0x01000000; // UART2 Power-ON

The cable that is used to connect RS232 between Comport of computer PC and UART-0 Connector and UART2 Connector of Board CP-JR ARM7 LPC2368 is shown below.

ETT CO.,LTD.

-15-

WWW.ETT.CO.TH

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368


1 6 2 7 3 8 4 9 5 DB 9(FEMALE) RS 232-PC CD DS R RXD RTS TXD CTS DTR RI GND

RXD TXD GND

1 2 3 4 ET-RS232

1 14 2 15 3 16 4 17 5 18 6 19 7 20 8 21 9 22 10 23 11 24 12 25 13 DB 25(FEMALE) RS 232-PC

TXD RXD RTS CTS DS R GND DTR RXD TXD GND 1 2 3 4 ET-RS232

Figure displays the Cable circuit for RS232.

ETT CO.,LTD.

-16-

WWW.ETT.CO.TH

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368

Application of RS422/485
For RS422/485 Communication Circuit of Board CPJR 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 (FullDuplex), 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.

RX(+) TX(-) TX(+) GND

+5V RX(-)

-17-

WWW.ETT.CO.TH

Users 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

NC 485(-)

Figure displays position of signal Pin when using it to be RS485 (Half-Duplex).

ETT CO.,LTD.

485(+) GND

+5V NC

RX(+) TX(-) TX(+) GND

+5V RX(-)

-18-

WWW.ETT.CO.TH

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368


+5V J16 3 2 1 J15 RL +5V C42 U6 75176 1 2 3 4 R RE DE D VC C B A GND R60 1K R61 1K R62 120 3 2 1 RH

J17 3 2 1 RZ

100n 8 7 6 5 +5V +5V C43 RXRX+ TXTX+

J18 RS422/485 1 2 3 4 5 6

FULL/HALF J19 U7 75176 RXD3 422/485 +5V P1[19] TXD3 J20 1 2 3 1 2 3 4 R RE DE D VC C B A GND 1 2 3

100n 8 7 6 5

R63 1K J21 TH 1 2 3 +5V

R64 1K

R65 120 J23 1 2 3 TZ

J22 1 2 3 TL

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

Users 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

Users 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; // Select P0.0 = TxD(UART3) PINSEL0 |= 0x00000008; // Select P0.1 = RxD(UART3) PCONP |= 0x02000000; // UART3 Power-ON // Config P1.19 = Output Control Direction RS485 // P1.19 = "0" = Received RS485 // P1.19 = "1" = Transmit RS485 PINSEL3 &= 0xFFFF3FFF; // P1.19 = GPIO IODIR1 = 0x00080000; // Pin Control Direction RS485 = Output // Select Direction RS485 = Receive IOCLR1 = 0x00080000; // 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

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368

P2.0 P2.2 P2.4 P2.6 +3V3 P2[0..7]

P2.1 P2.3 P2.5 P2.7 GND

P0.4 P0.6 P1.20 P1.22 +3V3 P0[4..7],P1[20..23]

P0.5 P0.7 P1.21 P1.23 GND

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

Users 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.

U3 LD1085 J12 1 2 3 GND IN OUT 2 + C29 470uF/16V

+3V3

R49 560 D9 PWR

J13

3 2 1

7-12Vdc

D10 BR IDGE 3 + C31 220uF/25V C32 100n

U4 AP1117-5.0 GND IN OUT 2 + C33 100uF/16V

C30 100n

+5V

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.

C34 100n

-23-

WWW.ETT.CO.TH

Users 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 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 Rate 19200. Set Device to be LPC2368. Set Interface to be None ISP. Set Crystal Oscillator with MHz corresponding with the value internal

2.2

2.3 2.4 2.5

ETT CO.,LTD.

-24-

WWW.ETT.CO.TH

Users Manual of Board Microcontroller CP-JR ARM7 LPC2368

2.6

Board. In this case, it is 12.000MHz, 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

1 U1 LPC2368 ENET-TXD0 ENET-TXD1 ENET-TX_EN ENET-CRS ENET-RXD0 ENET-RXD1 ENET-RX_ER ENET-RX_CLK ENET-MDC ENET-MDIO USB_LED DIR_485 P1.20 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 95 94 93 92 91 90 89 88 87 86 32 33 34 35 36 37 38 39 40 43 44 45 21 20 27 26 82 85 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 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 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 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_DP2.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 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 XTAL2 XTAL1 RTCX1 RTCX2

46 47 98 99 81 80 79 78 77 76 48 49 62 63 61 60 59 58 57 56 9 8 7 6 25 24 29 30 75 74 73 70 69 68 67 66 65 64 53 52 51 50 4 2 3 5 100 1 14 17 16 18 C13 22pF

TXD3 RXD3 TXD0 RXD0

+3V3 P0.4 P0.5 P0.6 P0.7 TRST TDI TMS TCK RTCK TDO RESET J2 1 2 3 RUN/DEBUG

R4 R5 R6 R7 10K 10K 10K 10K

D J1 JTAG 1 3 5 7 9 11 13 15 17 19 2 4 6 8 10 12 14 16 18 20

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 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 P3.25/MAT0.0/PWM1.2 P3.26/MAT0.1/PWM1.3 P4.28/MAT2.0/TXD3 P4.29/MAT2.1/RXD3

CD WP TXD2 RXD2

P0.15 P0.16 P0.17 P0.18

MCICLK MCICMD MCIPWR MCIDAT0 P0.23 P0.24 P0.25 P0.26 P0.27 P0.28 USB_D+ USB_DP2.0 P2.1 P2.2 P2.3 P2.4 P2.5 P2.6 P2.7 P2.8 USB_CON MCIDAT1 MCIDAT2 MCIDAT3 TRST TDI TMS TCK RTCK TDO RESET Y2 32.768KHz C14 22pF RESET ISP_BOOT

+3V3

+3V3

R1 22K SW1 ISP LOAD C15 100n R3 1K

R8 R9 R10 R11 10K 10K 10K 10K

L1 BEAD + C1 10u C2 C3 100n 100n

+3V3 P0.15 P0.16 P0.17 P0.18

J3 1 2 3 4 5 6 SPI-0

+3V3

10 12 13 42 84

VDDA VREFA DC-DC_3.3V_VDD1 DC-DC_3.3V_VDD2 DC-DC_3.3V_VDD3 VDD1 VDD2 VDD3 VDD4

P2.0 P2.2 P2.4 P2.6 +3V3

J4 P2.0-P2.7 1 3 5 7 9 2 4 6 8 10

P2.1 P2.3 P2.5 P2.7

C5 C6 C4 100n 100n 100n B +3V3

28 54 71 96

ISP_BOOT

+3V3

+3V3 P0.27 P0.28 SW2

J5 1 2 3 4 I2C-0

C10 C7 C8 C9 100n 100n 100n 100n PMEG4005ET D1 D2 B1 3V A PMEG4005ET

R2 47K RESET RESET C16 100n

P0.4 P0.6 P1.20 P1.22 +3V3

J6 KEY4X4 1 3 5 7 9 +3V3 J8 1 2 3 D/A 2 4 6 8 10

P0.5 P0.7 P1.21 P1.23

19 15 31 41 55 72 97 83 11

VBAT VSS1 VSS2 VSS3 VSS4 VSS5 VSS6 VSS7 VSSA

+3V3 P0.24 P0.25

J7 1 2 3 4 A/D

P0.26

+3V3

23

22

Y1 12MHz

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 Sheet 1 of 4 Drawn By: 4 Revision 1.0

C11 22pF

C12 22pF

+3V3 C17 D 100n 4 2

R12 10K +3.3V E/D 1 3 GND OUT OSC1 50MHz ENET-MDC ENET-MDIO RESET R13 D3 2K2 R14 680 36 35 34 50 MHz 33 32 31 30 29 28 LED_LINK 27 LED_SPEED 26 LED_ACT 25 +3V3 100Mb ENET-RX_CLK R15 4K87 1% U2 DP83848 C19 100n PFBOUT + 24 C20 23 10u 22 21 20 19 C21 100n 18 PFBOUT 17 16 15 14 13 +3V3 +3V3 D

PFBOUT C18 100n C +3V3 ENET-CRS ENET-RX_ER ENET-RXD0 ENET-RXD1 2K2 R16 37 38 39 40 41 42 43 44 45 46 47 48

DGND IOGND X1 X2 IOVDD33 MDC MDIO RESET_N LED_LINK/AN0 LED_SPEED/AN1 LED_ACT/COL/AN_EN 25MHZ_OUT

TK_CLK TX_EN TXD_0 TXD_1 TXD_2 TXD_3/SNI_MODE PWR_DOWN/INT NC NC NC NC NC

+3V3 C22 100n

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

RBIAS PFBOUT AVDD33 NC NC AGND PFBIN1 TD+ TDAGND RD+ RD-

R17 R18 2K2 2K2

R19 50

+3V3 C23 100n

+3V3 1 C24 100n

J9 RJ45_PRJ-005 TD+ CT TDRD+ CT RDRX1CT:1 TXRX+ TX+

C 1

R20 50

4 2 3

2 3

R21 50

C25 100n +3V3 +3V3

C26 100n

5 6

6 4 5 7 8

R22 50

ENET-TX_EN ENET-TXD0 ENET-TXD1

1 2 3 4 5 6 7 8 9 10 11 12

R23 10K

+3V3 R24 D4 LED_LINK LINK LED_ACT D5 R26 2K2 R27 110 ACT 2K2 R25 110

NC +3V3 7 8

CHS GND

Title Size A4 Date: File: 1 2 3

CP-JR ARM7 LPC2368


Number ETT CO.,LTD.(WWW.ETT.CO.TH) 31-Jan-2008 D:\My Circuit\LPC2368.Ddb Sheet 2 of 4 Drawn By: 4 Revision 1.0

3 R35 10K R36 10K CD 9 1 2 3 4 5 6 7 8 WP DAT2 CD/DAT3 CMD VSS VDD CLK VSS DAT0 DAT1

+3V3 R28 R29 D R30 R31 R32 R33 R34 10K 10K 10K 10K 10K 10K 10K RS EN RW D4 D5 D6 D7

R28-R34=NA

R66,R67 = NA P R38 22K +5V P2 10K Contrast +3V3 2 1 +5V RS EN D1 D3 D5 D7 J10 1 3 5 7 9 11 13 2 4 6 8 10 12 14 GND VO RW D0 D2 D4 D6 N R37 3K3 MCIPWR R66 3K3 Q1 FDC6327 5 6 + 3 4

+3V3

R67 0 SD/VDD J26 1 2 3

CD WP

CN1 SD-CARD

+3V3 MCIDAT2 MCIDAT3 MCICMD MCICLK R39 560 MCIDAT0 MCIDAT1

LCD_RS LCD_EN LCD_DB5 LCD_DB7

LCD_RW LCD_DB4 LCD_DB6

C27 C28 10u 100n

D6 SD

ET-CLCD (5V)

C D7 UGL USB_LED USB_CON J11 U3 LD1085 J12 1 2 B 3 GND IN OUT 2 + C29 470uF/16V +3V3 R49 560 C30 100n D9 PWR 1 2 3 R42 2K2 R40 +3V3 560 +5V-USB R41 10K Q2 BC807 USB_VBUS R45 1K5 R46 560 R44 3K3

R43 2K2

UMODE

J13

B D8 USC +5V-USB

3 2 1

7-12Vdc

D10 BRIDGE 3 + C31 220uF/25V C32 100n

U4 AP1117-5.0 GND IN OUT

2 +

+5V USB_DUSB_D+ C34 100n C35 18pF C36 18pF

R47 33 R48 33

1 D- 2 D+ 3 4

J14

C33 100uF/16V

USB PORT_B

Title Size A4 Date: File: 1 2 3

CP-JR ARM7 LPC2368


Number ETT CO.,LTD.(WWW.ETT.CO.TH) 31-Jan-2008 D:\My Circuit\LPC2368.Ddb Sheet 3 of 4 Drawn By: 4 Revision 1.0

+3V3 D D11 LL4148

R50 10 SP1 SPEAKER

+3V3

+3V3 +3V3

R53 560

R54 560 P0.23

D R55 470 P1 10K +5V J16 3 2 1 J15 RL 3 2 1 RH

D12 P3.25 P2.8 R51 1K R52 10K +3V3 +3V3 Q3 BC817 P3.25 P3.26

D13 P3.26

J17 3 2 1 RZ

C42 C P4.28 R56 10K R58 1K SW3 P4.28 P4.29 R59 1K SW4 P4.29 1 2 3 4 R57 10K U6 75176 R RE DE D VCC B A GND 100n 8 7 6 5

+5V R60 1K R61 1K R62 120 C

+5V C43 +5V RXRX+ TXTX+

J18 RS422/485 1 2 3 4 5 6

FULL/HALF J19 U7 75176 R RE DE D VCC B A GND 1 2 3

100n 8 7 6 5

+3V3 1 C38 100n 3 4 C40 100n C1C2+ V+ V2 6 U5 C1+ VCC 16

RXD3 422/485 +5V DIR_485 TXD3 J20 1 2 3

C37 100n C39 100n

1 2 3 4

B R63 1K J21 TH R64 1K R65 120 J23 1 2 3 TZ

5 12 11 9 10

C2R1O T1I R2O T2I ICL3232

GND R1I T1O R2I T2O

15 13 14 8 7

C41 100n

+3V3 RXD-2 TXD-2

J24 UART-2 1 2 3 4 J25 DOWNLOAD 1 2 3 4

1 2 3 +5V

J22 1 2 3 TL

RXD2 TXD2 RXD0 TXD0

+3V3 A RXD-0 TXD-0

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 Sheet 4 of 4 Drawn By: 4 Revision 1.0

Das könnte Ihnen auch gefallen