Академический Документы
Профессиональный Документы
Культура Документы
EE-522
2/9/2016
Compiler
We will be using CCS PICC
Built-in RTOS library
Has a time-driven (variant of cyclic) scheduler for RT-task
scheduling
Supports multi-tasking and delay functions
Non-preemptive scheduler in nature
User friendly
Built-in functions for I/Os
Support for standard C functions e.g. printf , scanf , etc.
EE-522
2/9/2016
//TurnsallPINSonPortBhigh
output_low(PIN_B5);
//OnlyPIN5ofPortBwillbehigh
output_high(PIN_B4);
//OnlyPIN4ofPortBwillbelow
output_toggle(PIN_B3);
//TogglePIN3ofPortB
input_b();
//TurnsPortBasinputandreturnscomplete
//1byteofdatavaluestoredatPortB
input(PIN_B7);
EE-522
//TurnsPIN7ofPORTBasinputandreturns
//singlebiti.e.1ifitishighelse0
2/9/2016
//turnallpinsofportBON
output_d(255);
//turnallpinsofportBON
delay_ms(500);
//introduceadelayof500ms
output_b(0);
//turnallpinsofportBON
output_d(0);
//turnallpinsofportBON
delay_ms(500);
//printHelloWorldtooutputdevice(serialport)
printf("HelloWorld\n\r");
}
EE-522
2/9/2016
EE-522
2/9/2016
Softwares Needed
PIC-C Programming Environment
MikroProg Suite to program the PIC18F452
Hyper Terminal for serial output on Windows
Make sure all of them are installed on the PC where you are working
If not get them from the TAs
EE-522
2/9/2016
SWs Needed
EE-522
2/9/2016
Lab-1 Manual
EE-522
2/9/2016
PICC-RTOS API
# use rtos (options)
timer
minor_cycle
statistics
# task (options)
rate
max
rtos_run()
rtos_terminate()
rtos_enable(task)
rtos_disable(task)
10
EE-522
rtos_stats()
rtos_overrun()
rtos_await (expression)
rtos_wait(semaphore)
rtos_signal(semaphore)
rtos_yield ()
2/9/2016
11
EE-522
voidmain()
{
out=0xFF;
rtos_run();
sleep();
}
2/9/2016
rtos_run()
rtos_terminate
RTOS
Time Period 1
Time Period 2
return/wait
TASK1
12
EE-522
TASK2
2/9/2016
Lab-1 Manual
13
EE-522
2/9/2016
W1:21/1
RT-Scheduling
W2:26/1
Static Scheduling
Algos
W2:28/1
Dynamic Scheduling
Algos-I
W3:02/2
Dynamic + PriorityDriven Schedulers
W3:04/2
Mem-mapped IOs,
GPIOs etc.
W4:09/2
Lab1
(PIC-based)
W4:11/2
Lab2
(PIC-based)
W5:16/2
Commercial RTOS
W5:18/2
Linux Device
Drivers
W6:23/2
Lab3
(VM-Linux Kernel)
W6:25/2
Commercial RTOS
W7: 01/3
Resource Sharing
W7:03/3
Resource Sharing in
MP
W8:08/3
Lab4
(Mini6410-based)
W8:10/3
Mid term
W9:22/3
Lab5
(Mini6410-based)
W9:24/3
RT Comm.
W10:29/3
RT Comm. II
W10:31/3
Lab6
(Mini6410-based)
W11:05/4
Lab7
(Mini6410-based)
W11:07/4
RT Databases
W12:12/4
Lab8
(Mini6410-based)
W12:14/4
Lab9
(Mini6410-based)
W13:19/4
Lab10
(Mini6410-based)
W13:21/4
Lab11
(Mini6410-based)
W14:26/4
Lab12
(Lab Project)
W14:28/4
Lab13
(Lab Project)
W15:03/5
RT Databases
W15:05/5
Lab14
(Lab Project Demo)
14
EE-522
2/9/2016
15
EE-522
2/9/2016