Файл: Embedded system development and labs for ARM (R. Muresan, 2005).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 13.06.2025

Просмотров: 2345

Скачиваний: 4

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Embedded Systems Development and Labs; The English Edition

bit is 0/1, the pull-up resistor of the pin is enabled/disabled.

(4) External Interrupt Control Register

The 8 external interrupts are activated through various signaling methods that are programmed in the EXTINT register. The signaling methods available are: low level trigger, high level trigger, falling edge trigger, rising edge trigger, and both edge triggers for the external interrupt request

Table 4-12 to Table 4-18 show the pin definitions of each port.

Table 4-12 Port A

Port A

Pin function

Port A

Pin function

Port A

Pin function

PA0

ADDR0

PA4

ADDR19

PA8

ADDR23

PA1

ADDR16

PA5

ADDR20

PA9

OUTPUT(IIS)

PA2

ADDR17

PA6

ADDR21

PA3

ADDR18

PA7

ADDR22

PCONA access address: 0X01D20000

PDATA access address: 0X01D20004

PCONA reset value: 0X1FF

Table 4-13 Port B

Port B

Pin function

Port B

Pin function

Port B

Pin function

PB0

SCKE

PB4

OUTPUT(IIS)

PB8

NGCS3

PB1

SCLE

PB5

OUTPUT(IIS)

PB9

OUTPUT(LED1)

PB2

nSCAS

PB6

nGCS1

PB10

OUTPUT(LED2)

PB3

nSRAS

PB7

NGCS2

PCONB access address: 0X01D20008

PDATB access address: 0X01D2000C

PCONB reset value: 0X7FF

Table 4-14 Port C

Port C

Pin function

Port C

Pin function

Port C

Pin function

PC0

IISLRCK

PC6

VD5

PC12

TXD1

PC1

IISDO

PC7

VD4

PC13

RXD1

PC2

IISDI

PC8

INPUT(UART)

PC14

INPUT(UART)

PC3

IISCLK

PC9

INPUT(UART)

PC15

INPUT(UART)

PC4

VD7

PC10

RTS1

PC5

VD6

PC11

CTS1

PCONC access address: 0X01D20010

PDATC access address: 0X01D20014

146


Embedded Systems Development and Labs; The English Edition

PUPC access address: 0X01D20018

PCONC reset value: 0X0FF0FFFF

Table 4-15 Port D

Port D

Pin function

Port D

Pin function

Port D

Pin function

PD0

VD0

PD3

VD3

PD6

VM

PD1

VD1

PD4

VCLK

PD7

VFRAME

PD2

VD2

PD5

VLINE

PCOND access address: 0X01D2001C

PDATD access address: 0X01D20020

PUPD access address: 0X01D20024

PCOND reset value: 0XAAAA

Table 4-16 Port E

Port E

Pin function

Port E

Pin function

Port E

Pin function

PE0

OUTPUT(LCD)

PE3

RESERVE

PE6

OUTPUT(TSP)

PE1

TXD0

PE4

OUTPUT(TSP)

PE7

OUTPUT(TSP)

PE2

RXD0

PE5

OUTPUT(TSP)

PE8

CODECLK

PCONE access address: 0X01D20028

PDATE access address: 0X01D2002C

PUPE access address: 0X01D20030

PCONE reset value: 0X25529

Table 4-17 Port F

Port F

Pin function

Port F

Pin function

Port F

Pin function

PF0

IICSCL

PF3

IN(Nand Flash)

PF6

out(Nand Flash)

PF1

IICSDA

PF4

out(Nand Flash)

PF7

IN(bootloader)

PF2

RESERVED

PF5

out(Nand Flash)

PF8

IN(bootloader)

PCONF access address: 0X01D20034

PDATF access address: 0X01D20038

PUPF access address: 0X01D2003C

PCONF reset value: 0X00252A

147


Embedded Systems Development and Labs; The English Edition

Table 4-18 Port G

Port G

Pin function

Port G

Pin function

Port G

Pin function

PG0

EXINT0

PG3

EXINT3

PG6

EXINT6

PG1

EXINT1

PG4

EXINT4

PG7

EXINT7

PG2

EXINT2

PG5

EXINT5

PCONG access address: 0X01D20040

PDATG access address: 0X01D20044

PUPG access address: 0X01D20048

PCONG reset value: 0XFFFF

2. The Description of the Circuit

In Table 4-13 PB9 and PB10 pins are defined as outputs and are connected to LED1 and LED2. Figure 4-5 shows the circuit connections for the LED1 and LED2. The anodes of LED1 and LED2 are connected to the pin 47 of S3C44B0X which is VDD33. VDD33 pin provides a 3.3V dc voltage. The cathodes of LED1 and LED2 are connected to pin 23 (PB9) and 24 (PB10), respectively. These two pins belong to Port B and have been configured as outputs. Writing a 1 or a 0 to the specific bit of the PDATAB register can make the pin’s output low or high. When the pin 23, 24 is low, the LEDs will be on (lit). When the pin 23, 24 is high, the LEDs will be off.

23

R95

LED1

NGCS4

NGCS5

24

R96

S3C44B0X

LED2

VDD33

47

Figure 4-5. Connection diagram to LED 1 and LED 2

4.2.5 Operation Steps

1)Prepare the Lab environment. Connect the Embest Emulator to the target board. Connect the target board UART0 to the PC serial port through the serial cable provided by the Embest development system.

2)Run the PC Hyper Terminal (set to 115200 bits per second, 8 data bits, none parity, 1 stop bits, none flow control).

3)Connect the Embest Emulator to the target board. Open the LED_test.ews project file that is located in the …\EmbestIDE\Examples\Samsung\S3CEV40 directory. Compile and link the project. Connect to the target

148


Embedded Systems Development and Labs; The English Edition

board and download the program.

NOTE: please note that the debug window should be set as in Figure 4-5a:

Figure 4-5a. Debug settings for the project

4)Watch the hyper terminal output. The following should be displayed: Embest 44B0X Evaluation Board (S3CEV40)

LED Test Example

5)The LED1 and LED2 will be in the following states:

LED1 on Æ LED2 on Æ LED1 and LED2 onÆ LED2 off Æ LED1 off.

4.2.6 Sample Programs

/*****************************************************************************

*File Name: light.c

*Author: embest

*Description: control board's two LEDs on or offf

*History:

*****************************************************************************/

/*--- include files ---*/ #include "44b.h" #include "44blib.h"

/*--- global variables ---*/

int led_state;

/* LED status

*/

/*--- function declare ---*/

void Led_Test();

/* LED test

*/

void leds_on();

/* all leds on

*/

void leds_off();

/* all leds off */

void led1_on();

/* led 1 on

*/

void led1_off();

/* led 1 off

*/

149

Embedded Systems Development and Labs; The English Edition

void led2_on();

/* led 2 on

*/

void led2_off();

/* led 2 off

*/

//void Led_Display(int LedStatus);

/* led control */

/*--- function code---*/ /*************************************************************************

* name:

Led_Test

* func:

leds test funciton

* para:

none

* ret:

none

*modify:

*comment:

**************************************************************************/

void Led_Test()

{

/* 1 on -> 2 on -> all on -> 2 off -> 1 off */ leds_off();

Delay(1000); led1_on(); Delay(1000); led1_off(); led2_on(); Delay(1000); leds_on(); Delay(1000); led2_off(); Delay(1000); led1_off();

}

/***************************************************************************

* name:

leds_on

* func:

all leds on

* para:

none

* ret:

none

*modify:

*comment:

***************************************************************************/

void leds_on()

{

Led_Display(0x3);

150