Released_task_Embedded_System_Programming_140107 1 of 19
Embedded System Programming
Released_task_Embedded_System_Programming_140107 2 of 19
CONTENTS
This project consists of the following documentation/files:
1. TP16_42GE_TW_EN_Software.doc
2. Test.hex
3. Example.c
4. Datasheets folder
5. Video folder
This project consists of the following boards:
1. PIC-kit board
2. Task board
Figure 1. Photograph of PCB boards TASK This project is to design a 1616 color LED matrix controller and its applications.
There are four main functions:
1. Scrolling string display.
2. 2D water level meter.
3. Auto-oriented display.
4. Digital voltage meter.
PIC-kit board Task board
+12V
GND
for ICD3
Released_task_Embedded_System_Programming_140107 3 of 19
TEST PROGRAM
1. The aim of this test program is to test and verify the hardware function of the task board.
2. The microcontroller has built-in a test program for LEDs (LED1 - LED4), DIP SW (S1),
varied resistor (VR1), 3D Accelerometer module (U1) and LED matrix test.
3. On power up,
(1) The LED1 - LED4 will scan sequentially as the following order: LED1, LED2, LED3, LED4, LED3,
LED2, LED1, LED2, LED3, LED4, LED3, LED2, LED1… and
(2) LED matrix will scan RED sequentially from left column to right column, then from bottom row to top
row. Then, LED matrix will scan GREEN sequentially from left column to right column, then from bottom
row to top row.
4. After LED and LED matrix tests, you can test the DIP SW, varied resistor and 3D Accelerometer module
following Table 1.
Table 1.
DIP SW LED1~LED4 Functions DS1
Off, Off, Off Remained
scanning
DS1 varies with the VR1
adjustment
minimum
Off, Off, On DS1 varies with the Zout
of accelerometer
Off, On, Off DS1 varies with the Yout
of accelerometer
On, Off, Off DS1 varies with the Xout
of accelerometer
Released_task_Embedded_System_Programming_140107 4 of 19
maximum
Released_task_Embedded_System_Programming_140107 5 of 19
TASK NEW PROGRAMM
You have to create a new program to finish the following tasks. There are four tasks, which are selected by
DIP SW following table 2.
Table 2. DIP SW (S1) LED1 - LED4 Functions
Off, Off, Off
(000)
Off, Off, Off, On
(0001)
TASK A
Off, Off, On
(001)
Off, Off, On, Off
(0010)
TASK B
Off, On, Off
(010)
Off, On, Off, Off
(0100)
TASK C
On, Off, Off
(100)
On, Off, Off, Off
(1000)
TASK D
Others Off, Off, Off, Off
(0000)
DS1 off
Task A: Scrolling string display
(1) When S1 is 000, DS1 should display the correct real-time message “WSC”.
(2) Initially, the string “WSC 2013” should be displayed and scrolled in RED at correct positions on DS1.
The dot layout of characters and numbers is shown in Figure 2, and the string should be scrolled left
about every 0.2 sec.
(3) If finger hits the task board, the colour of DS1 should be changed in the sequence, RED, YELLOW,
GREEN, RED, YELLOW, GREEN….. , shown in Figure 2. The function should include de-bouncing.
(4) LED1~LED4 should follow table 2.
Figure 2. The dot layout of characters and numbers
Released_task_Embedded_System_Programming_140107 6 of 19
Task B: 2D water level meter
(1) When S1 is 001, DS1 should function as a 2D water level meter immediately.
(2) When the PCB is lying on the table, a GREEN bubble with 22 dots should be displayed in the
centre of DS1, as shown in Figure 3.
(3) When Yout = 0g, the bubble should move to correct position smoothly following the PCB tilt angle
(Xout), as shown in Figure 4.
(4) When Xout = 0g, the bubble should move to correct position smoothly following the PCB tilt angle
(Yout), as shown in Figure 5.
(5) When both of Xout and Yout are not 0g, the bubble should move to the correct position smoothly
following the PCB tilt angle (Xout and Yout).
(6) The display and Bubble movements are stable and no glitch.
(7) LED1 - LED4 should follow table 2.
Figure 3
Released_task_Embedded_System_Programming_140107 7 of 19
Figure 4. Yout = 0g, Xout from -1g to +1g
Figure 5. Xout = 0g, Yout from +1g to -1g
Released_task_Embedded_System_Programming_140107 8 of 19
Task C: Auto-Oriented display
(1) When S1 is 010, DS1 should function as an auto-oriented display immediately.
(2) The display pattern should follow table 3.
(3) LED1 - LED4 should follow table 2.
Table 3.
Accelerometer DS1 pattern Accelerometer DS1 pattern
Xout = 0 g
Yout = 0 g
Zout = +1 g
or
Xout = 0 g
Yout = +1 g
Zout = 0 g
DS1
Xout = +1 g
Yout = 0 g
Zout = 0 g
DS1
Xout = 0 g
Yout = -1 g
Zout = 0 g
DS1
Xout = -1 g
Yout = 0 g
Zout = 0 g
DS1
Figure 6. ADXL335 output with gravity
Released_task_Embedded_System_Programming_140107 9 of 19
Task D: Digital voltage meter
(1) When S1 is 100, DS1 should function as a digital voltage meter immediately.
(2) The DS1 should display the voltage value of TP4 with X.X format, as shown in Figure 7 (a); the error
should 0.1V. The dot layout of numbers is shown in Figure 7 (b).
(3) The display is stable and no glitch.
(4) LED1 - LED4 should follow table 2.
(a) (b)
Figure 7. (a) Pattern of DS1 when TP4 = 0.0V and 1.1V (b) The dot layout of numbers
Others
(1) When S1 is 011, 101, 110 or 111, DS1 and LED1 - LED4 should be all off.
Released_task_Embedded_System_Programming_140107 10 of 19
MARKING SCHEME
The completed tasks will be weighted as follows:
Task Mark
A TASK A-1 When S1 is 000, DS1 clear and display correct real-time message “WSC”.
1
TASK A-2-1 Initially, the string “WSC 2013” should be displayed and scrolled in RED at
correct positions on DS1.
1
TASK A-2-2 The string should be scrolled left about every 0.2 sec.
1
TASK A-3-1 If finger hits the task board, the color of DS1 should be changed in the
sequence, RED, YELLOW, GREEN, RED, YELLOW, GREEN.
1.5
TASK A-3-2 The function should include de-bouncing.
1
TASK A-4 Display correct LEDs (LED1~LED4) based on S1 value.
0.5
B TASK B-1 When S1 is 001, DS1 should function as a 2D water level meter immediately.
1
TASK B-2 When the PCB is lying on the table, a GREEN bubble with 22 dots should be
displayed in the center of DS1.
1
TASK B-3 When Yout = 0g, the bubble should move to correct position smoothly following
the PCB tilt angle (Xout).
1
TASK B-4 When Xout = 0g, the bubble should move to correct position smoothly following
the PCB tilt angle (Yout).
1
Released_task_Embedded_System_Programming_140107 11 of 19
TASK B-5 When both of Xout and Yout are not 0g, the bubble should move to the correct
position smoothly following the PCB tilt angle (Xout and Yout).
1
TASK B-6 The display and Bubble movements are stable and no glitch.
1
TASK B-7 Display correct LEDs (LED1~LED4) based on S1 value.
0.5
C TASK C-1 When S1 is 010, DS1 should function as an auto-oriented display immediately.
1
TASK C-2 Display correct pattern following table 3.
5
TASK C-3 Display correct LEDs (LED1~LED4) based on S1 value.
0.5
D TASK D-1 When S1 is 100, DS1 should function as a digital voltage meter immediately.
1
TASK D-2 Display correct voltage value of TP4 on DS1.
2.5
TASK D-3 The display and Bubble movements are stable and no glitch.
1
TASK D-4 Display correct LEDs (LED1~LED4) based on S1 value.
0.5
Others Display correct LEDs (LED1~LED4) and DS1 based on S1 value. 1
Total 25
Released_task_Embedded_System_Programming_140107 12 of 19
OTHERS 1. PIC-kit board schematics:
D4
D9
+12V
GNDGND
GND
-12V
GND
GND
+5V_PC +5V_USB+5V_EXT
GND
+5V_PC+12V
GNDGND GND
+5V_TC+12V
Supply +5V TASK CARD
Supply +5V PIC Card
Extern Supply100nFC13
100nFC14
100nFC11
100nFC16
100nFC18
100nFC21
100nFC22
1KR8
123
X8
1 2 3
X7
GND
1KR5
GND
330RR6
GND
330RR7
+12V +5V_PC +5V_TC-12V
Power LEDs
GND
TPJ33
TPJ34
TPJ35
TPJ36
TPJ37
10uFC15
10uFC17
-12V
+12V
10uFC10
10uFC20
GND
10uFC19
10uFC12
GND
GND
10uFC9
GND GND
GNDIN3
1
OUT 2
U3
1117 - SOT223
GNDIN1
2
OUT 3
U4
7805 - TO-263-2D8 D5 D6 D7
GND
Released_task_Embedded_System_Programming_140107 13 of 19
GND
GND
+5V_PC
GND
GND GND
GND
MCLR
IO16IO17IO18
MCLR
+5V_PC
IO15IO14
+5V_PCANA0ANA1ANA2ANA3
SS
IO8IO9IO10IO11IO12IO13IO14IO15IO15
IO14
IO0IO1IO2IO3IO4IO5IO6IO7
PWM1PWM0
100nFC4
22pFC5
22pFC6
ICD3
PIC18F4550
RC7/RX/DT/SDO 1
RD4/SPP4 2
RD5/SPP5/P1B 3
RD6/SPP6/P1C 4
RD7/SPP7/P1D 5
VSS6
VDD7
RB0/AN12/INT0/FLT0/SDI/SDA 8
RB1/AN10/INT1/SCK/SCL 9
RB2/AN8/INT2/VMO 10
RB3/AN9/CCP2/VPO 11
NC/ICCK/ICPGC12
NC/ICDT/ICPGD13
RB4/AN11/KBI0/CSSPP 14
RB5/KBI1/PGM 15
RB6/KBI2/PGC 16
RB7/KBI3/PGD 17
MCLR/VPP/RE318
RA0/AN0 19
RA1/AN1 20
RA2/AN2/VREF-/CVREF 21
RA3/AN3/VREF+ 22
RA4/T0CKI/C1OUT/RCV 23
RA5/AN4/SS/HLVDIN/C2OUT 24
RE0/AN5/CK1SPP 25RE1/AN6/CK2SPP 26
RE2/AN7/OESPP 27
VDD28
VSS29
OSC1/CLKI30
OSC2/CLKO/RA631 RC0/T1OSO/T13CKI 32
NC/ICRST/ICVPP33
NC/ICPORTS34
RC1/T1OSI/CCP2/UOE 35
RC2/CCP1/P1A 36
VUSB37
RD0/SPP0 38
RD1/SPP1 39
RD2/SPP2 40
RD3/SPP3 41
RC4/D-/VM 42
RC5/D+/VP 43
RC6/TX/CK 44
U2
10kR4
1 243S1
100nFC8
GNDGND
10uFC7
12
X5
+5V_PC
16MHzY1
ANA0ANA1ANA2ANA3
SS
IO10IO11IO12IO13
PWM1PWM0
IO0IO1IO2IO3IO4IO5IO6IO7
IO16IO17IO18
TXRX
TXRX
IO8IO9
GND
MCLRIO15IO14
PicKit3
/MCLR/Vpp 1
PGD (ICSPDAT) 4
PGC (ICSPCLK) 5
PGM (LVP) 6
GND 3
VDD 2X6
Power_Deb
Power_Deb
Power_Deb
SocketX4
/MCLR/Vpp 1
PGD (ICSPDAT) 4
PGC (ICSPCLK) 5
PGM (LVP) 6
COM 7
COM 8
GND 3
VDD 2J32
RJ12_ICD3 SMD
Released_task_Embedded_System_Programming_140107 14 of 19
Released_task_Embedded_System_Programming_140107 15 of 19
Connector 64pol
+12V +12V
GND GND
IO15 IO14IO13 IO12
IO11 IO10IO8IO9
IO7 IO6IO5 IO4
IO3 IO2IO0IO1
IO18IO17 IO16
ANA3 ANA2ANA0ANA1
PWM1 PWM0
SS
-12V -12V
+5V_TC +5V_TC
TPJ1
TPJ3
TPJ5
TPJ7
TPJ9
TPJ11
TPJ13
TPJ15
TPJ2
TPJ4
TPJ6
TPJ8
TPJ10
TPJ12
TPJ14
TPJ16
TPJ17
TPJ19
TPJ21
TPJ23
TPJ18
TPJ20
TPJ22
TPJ25
TPJ24
TPJ26
TPJ27
TPJ29
TPJ28
1 23 45 67 89 1011 1213 1415 1617 1819 2021 2223 2425 2627 2829 3031 3233 3435 3637 3839 4041 4243 4445 4647 4849 5051 5253 5455 5657 5859 6061 6263 64
X1
IO9IO8RX
RXTXTP
J31TP
J30
IO9 IO8
RXTX
SDI_SDA SCK_SCLSDO
Released_task_Embedded_System_Programming_140107 16 of 19
2. Task board schematics
Released_task_Embedded_System_Programming_140107 17 of 19
3. PIC-kit board layout
TOP layer Bottom layer
Released_task_Embedded_System_Programming_140107
18 of 19
4. Task board PCB layout
Top layer
Bottom layer
Released_task_Embedded_System_Programming_140107
19 of 19
5. ADXL335 module schematics