Skip to content

Commit 3ac7476

Browse files
author
liduanjun
committed
update
1 parent 6c6dff9 commit 3ac7476

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+636
-89
lines changed
Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
# ARM体系结构与接口技术 第5天
22

3-
## 课程大纲
4-
5-
## 教学目标
6-
7-
* GPIO 概念
8-
9-
* FS-4412 原理图 LED 查阅
10-
* Exynos 4412 LED-GPIO 寄存器
11-
* GPIO 流水灯相关实验
12-
13-
* FS-4412 原理图 Key 查阅
14-
* Exynos 4412 Key-GPIO 寄存器
15-
* GPIO 按键中断相关实验
16-
17-
* A/D 转换
3+
## 课程目的
4+
5+
1. 掌握 GPIO
6+
* GPIO 模块讲解
7+
* Exynos 4412 GPIO 框图
8+
* Exynos 4412 GPIO 寄存器介绍
9+
* Exynos 4412 GPIO 示例代码分析
10+
2. 掌握 ADC
11+
* ADC 模块讲解
12+
* Exynos 4412 ADC 框图
13+
* Exynos 4412 ADC 寄存器介绍
14+
* Exynos 4412 ADC 示例代码分析
15+
16+
## 教学大纲
17+
18+
* GPIO 输入输出控制
19+
* GPIO 模拟时序,读取DS18B20温度模块数据
20+
* GPIO 按键中断
21+
* ADC 普通查询式读取转换结果的数模转换
22+
* ADC 用中断方式查询结果的数模转换
1823
...
1924
未完待续
2025

@@ -25,8 +30,11 @@
2530

2631
## 作业安排
2732

28-
学生完成实验
29-
* 1.LED_GPIO
30-
* 2.Ket_Int
31-
* 6.ADC
32-
* 7.ADC_INT
33+
1. 查阅 "Exynos 4412 User Manual" 手册中关于 GPIO,Interrupt,ADC 相关章节
34+
2. 阅读 光盘文件 "华清远见-CORTEXA9资料1.iso" 中的 "/使用手册/实验手册/ARM体系结构与接口技术FS4412.pdf"
35+
3. 阅读,编译,运行,分析实验手册中相关代码
36+
* 1.LED_GPIO
37+
* 14.temperature
38+
* 2.Ket_Int
39+
* 6.ADC
40+
* 7.ADC_INT

4.驱动/ARM体系结构与结构技术/备课/Day5/KeyInterrupt.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ typedef struct {
2828
* Base Address: 0x1100_0000
2929
* Address = Base Address + 0x0C20, Reset Value = 0x0000_0000
3030
* ![GPX1CON1](resource/images/GPX1CON1.png)
31+
* GPX1DAT
32+
* Base Address: 0x1100_0000
33+
* Address = Base Address + 0x0C24, Reset Value = 0x0000_0000
34+
* ![GPX1DAT](resource/images/GPX1DAT.png)
3135
* GPX1PUD
3236
* Base Address: 0x1100_0000
3337
* Address = Base Address + 0x0C28, Reset Value = 0x5555
@@ -79,4 +83,60 @@ ICDIPTR.ICDIPTR14 = 0x01010101; //SPI25 SPI26 interrupts are sent to processor
7983
* ICDIPTR.ICDIPTR14
8084
* Base Address: 0x1049_0000
8185
* Address = Base Address + 0x0838, Reset Value = 0x0000_0000 (ICDIPTR14_CPU0)
82-
* ![ICDIPTR14](resource/images/ICDIPTR14.png)
86+
* ![ICDIPTR14](resource/images/ICDIPTR14.png)
87+
88+
## 按键中断处理程序
89+
90+
```
91+
void do_irq(void )
92+
{
93+
int irq_num;
94+
irq_num = (CPU0.ICCIAR & 0x1FF);
95+
switch (irq_num) {
96+
97+
case 58: //turn on LED2; turn off LED3
98+
GPX2.GPX2DAT = 0x1 << 7;
99+
GPX1.GPX1DAT &= ~0x1;
100+
printf("IRQ interrupt !! turn on LED2; turn off LED3\n");
101+
102+
//Clear Pend
103+
EXT_INT41_PEND |= 0x1 << 2;
104+
ICDICPR.ICDICPR1 |= 0x1 << 26;
105+
break;
106+
case 57: //Turn on Led3; Turn off Led2
107+
108+
GPX2.GPX2DAT &= ~(0x1 << 7);
109+
GPX1.GPX1DAT |= 0x1;
110+
printf("IRQ interrupt !! Turn on LED3; Turn off LED2\n");
111+
112+
//Clear Pend
113+
EXT_INT41_PEND |= 0x1 << 1;
114+
ICDICPR.ICDICPR1 |= 0x1 << 26;
115+
break;
116+
}
117+
118+
// End of interrupt
119+
CPU0.ICCEOIR = (CPU0.ICCEOIR & ~(0x1FF)) | irq_num;
120+
121+
}
122+
```
123+
* ICCIAR
124+
* Base Address: 0x1048_0000
125+
* Address = Base Address + 0x000C, Reset Value = 0x0000_0000
126+
* ![ICCIAR](resource/images/ICCIAR.png)
127+
* GPX1DAT
128+
* Base Address: 0x1100_0000
129+
* Address = Base Address + 0x0C24, Reset Value = 0x0000_0000
130+
* ![GPX1DAT](resource/images/GPX1DAT.png)
131+
* EXT_INT41_PEND
132+
* Base Address: 0x1100_0000
133+
* Address = Base Address + 0x0F44, Reset Value = 0x0000_0000
134+
* ![EXT_INT41_PEND](resource/images/EXT_INT41_PEND.png)
135+
* ICDICPR1
136+
* Base Address: 0x1049_0000
137+
* Address = Base Address + 0x0284, Reset Value = 0x0000_0000
138+
* ![ICDICPR1](resource/images/ICDICPR1.png)
139+
* ICCEOIR_CPU0
140+
* Base Address: 0x1048_0000
141+
* Address = Base Address + 0x0010, Reset Value = 0x0000_0000
142+
* ![ICCEOIR](resource/images/ICCEOIR.png)
Loading
Loading
Loading

4.驱动/ARM体系结构与结构技术/备课/Day6/Index.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
## 课程目的
44

5+
1. 掌握 PWM
6+
* PWM 原理讲解
7+
* PWM 模块讲解
8+
* Exynos 4412 PWM 框图
9+
* Exynos 4412 PWM 寄存器介绍
10+
* Exynos 4412 PWM 示例代码分析
11+
2. 掌握 RTC
12+
* RTC 模块讲解
13+
* Exynos 4412 RTC 框图
14+
* Exynos 4412 RTC 寄存器介绍
15+
* Exynos 4412 RTC 示例代码分析
16+
3. 掌握 WDT
17+
* WDT 模块讲解
18+
* Exynos 4412 WDT 框图
19+
* Exynos 4412 WDT 寄存器介绍
20+
* Exynos 4412 WDT 示例代码分析
21+
522
## 教学大纲
623

724
* 晶振,时钟,分频
@@ -11,4 +28,16 @@
1128

1229
## 教学内容
1330

14-
## 作业安排
31+
* [PWM](PWM.md)
32+
* [RTC](RTC.md)
33+
* [WDT](WDT.md)
34+
35+
## 作业安排
36+
37+
1. 查阅 "Exynos 4412 User Manual" 手册中关于 Clock,PWM,RTC,WDT 相关章节
38+
2. 阅读 光盘文件 "华清远见-CORTEXA9资料1.iso" 中的 "/使用手册/实验手册/ARM体系结构与接口技术FS4412.pdf"
39+
3. 阅读,编译,运行,分析实验手册中相关代码
40+
* 3.Buzzer_PWM
41+
* 4.WDT_INT
42+
* 5.Alarm_RTC
43+
* 5.RTC
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
*@brief This example describes how to use UART
3+
*@date: 12. June. 2014
4+
5+
*@Contact Us: http://dev.hqyj.com
6+
*Copyright(C) 2014, Farsight
7+
*/
8+
9+
#include "exynos_4412.h"
10+
11+
void mydelay(int time);
12+
13+
14+
/**********************************************************************
15+
* @brief mydelay_ms program body
16+
* @param[in] int (ms)
17+
* @return None
18+
**********************************************************************/
19+
void mydelay_ms(int time)
20+
{
21+
int i, j;
22+
while(time--)
23+
{
24+
for (i = 0; i < 5; i++)
25+
for (j = 0; j < 514; j++);
26+
}
27+
}
28+
29+
30+
/**********************************************************************
31+
* @brief uart_init, Normal mode, No parity,One stop bit,8 data bits
32+
* Buad-reate : 115200, clock srouce 100Mhz
33+
* @param[in] int (ms)
34+
* @return None
35+
**********************************************************************/
36+
void uart_init(void)
37+
{
38+
39+
/*UART2 initialize*/
40+
GPA1.GPA1CON = (GPA1.GPA1CON & ~0xFF ) | (0x22); //GPA1_0:RX;GPA1_1:TX
41+
42+
UART2.ULCON2 = 0x3; //Normal mode, No parity,One stop bit,8 data bits
43+
UART2.UCON2 = 0x5; //Interrupt request or polling mode
44+
45+
46+
/*
47+
* Baud-rate 115200: src_clock:100Mhz
48+
* DIV_VAL = (100*10^6 / (115200*16) -1) = (54.3 - 1) = 53.3
49+
* UBRDIV2 = (Integer part of 53.3) = 53 = 0x35
50+
* UFRACVAL2 = 0.3*16 = 0x5
51+
* */
52+
UART2.UBRDIV2 = 0x35;
53+
UART2.UFRACVAL2 = 0x5;
54+
}
55+
56+
void putc(const char data)
57+
{
58+
while(!(UART2.UTRSTAT2 & 0X2));
59+
UART2.UTXH2 = data;
60+
if (data == '\n')
61+
putc('\r');
62+
}
63+
void puts(const char *pstr)
64+
{
65+
while(*pstr != '\0')
66+
putc(*pstr++);
67+
}
68+
69+
unsigned char getchar()
70+
{
71+
unsigned char c;
72+
while(!(UART2.UTRSTAT2 & 0X1));
73+
c = UART2.URXH2;
74+
return c;
75+
}
76+
77+
/*-------------------------MAIN FUNCTION------------------------------*/
78+
/**********************************************************************
79+
* @brief Main program body
80+
* @param[in] None
81+
* @return int
82+
**********************************************************************/
83+
int main(void) {
84+
85+
char c, str[] = "uart test!! \n";
86+
87+
//LED
88+
GPX2.GPX2CON = 0x1 << 28;
89+
uart_init();
90+
91+
while(1)
92+
{
93+
//Turn on LED
94+
GPX2.GPX2DAT = GPX2.GPX2DAT | 0x1 << 7;
95+
puts(str);
96+
mydelay_ms(500);
97+
//Turn off LED
98+
GPX2.GPX2DAT = GPX2.GPX2DAT & ~(0x1 << 7);
99+
mydelay_ms(500);
100+
}
101+
return 0;
102+
}

4.驱动/ARM体系结构与结构技术/备课/Day7/I2C.md

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,36 @@
33
## 支持 I2C 总线的传感器之一 : 三轴加速度传感器
44

55
![schematic-i2c](resource/images/schematic-i2c.png)
6+
[三轴传感器MPU6050芯片手册](resource/MPU6050.pdf)
67

78
## I2C Block
89

910
![I2CBlock](resource/images/I2CBlock.png)
1011

11-
## I2C Flowcharts
12+
## I2C 协议
1213

13-
![I2CFlowcharts](resource/images/I2CFlowcharts.png)
14+
I2C 协议参考资料 :
15+
[飞利浦半导体I2C协议说明手册](resource/I2C_SPEC.pdf)
16+
17+
### I2C 启动停止条件
18+
19+
![I2CStartStopCondition](resource/images/I2CStartStopCondition.png)
20+
21+
### I2C 数据格式
22+
23+
![I2CDataTransferFormat](resource/images/I2CDataTransferFormat.png)
24+
25+
### I2C 数据传送时序图
26+
27+
![I2CDataOnI2CBus](resource/images/I2CDataOnI2CBus.png)
28+
29+
## I2C Master Transmitter Mode Flow Chart
30+
31+
![I2CMasterTransmitter](resource/images/I2CMasterTransmitter.png)
32+
33+
## I2C Master Receiver Mode Flow Chart
34+
35+
![I2CMasterReceiver](resource/images/I2CMasterReceiver.png)
1436

1537
## I2C 寄存器
1638

@@ -28,6 +50,27 @@ typedef struct {
2850
#define I2C5 (* (volatile i2c5 *)0x138B0000 )
2951
```
3052

53+
* I2CCON
54+
* Base Address: 0x138C_0000
55+
* Address = Base Address + 0x0000, Reset Value = 0x0000_0000
56+
* ![I2CCON](resource/images/I2CCON.png)
57+
* I2CSTAT
58+
* Base Address: 0x138C_0000
59+
* Address = Base Address + 0x0004, Reset Value = 0x0000_0000
60+
* ![I2CSTAT](resource/images/I2CSTAT.png)
61+
* I2CADD
62+
* Base Address: 0x138C_0000
63+
* Address = Base Address + 0x0008, Reset Value = 0x0000_0000
64+
* ![I2CADD](resource/images/I2CADD.png)
65+
* I2CDS
66+
* Base Address: 0x138C_0000
67+
* Address = Base Address + 0x000C, Reset Value = 0x0000_0000
68+
* ![I2CDS](resource/images/I2CDS.png)
69+
* I2CLC
70+
* Base Address: 0x138C_0000
71+
* Address = Base Address + 0x0010, Reset Value = 0x0000_0000
72+
* ![I2CLC](resource/images/I2CLC.png)
73+
3174
## I2C 代码
3275

3376
```
@@ -179,11 +222,3 @@ int main(void)
179222
* Base Address: 0x1140_0000
180223
* Address = Base Address + 0x0040, Reset Value = 0x0000_0000
181224
* ![GPBCON](resource/images/GPBCON.png)
182-
* I2CSTAT
183-
* Base Address: 0x138C_0000
184-
* Address = Base Address + 0x0004, Reset Value = 0x0000_0000
185-
* ![I2CSTAT](resource/images/I2CSTAT.png)
186-
* I2CCON
187-
* Base Address: 0x138C_0000
188-
* Address = Base Address + 0x0000, Reset Value = 0x0000_0000
189-
* ![I2CCON](resource/images/I2CCON.png)

0 commit comments

Comments
 (0)