Seminář z architektury digitálních systémů

6. Úvod do jazyka C pro programování PIC (ME)

Studijní materiály
 

 Šablona programu v C

Zadání příkladů

Task 1

Write in C language following example: GP0 and GP1 ports as outputs to diods. Period 1second (intruction cycle takes 1microsedond (1MHz)) - change the lighting diod after 1 sec using counters, not timers. The sequence shoud be: LED1ON & LED2OFF, BOTH OFF, LED1OFF & LED2ON, BOTH OFF, LED1ON & LED2OFF, BOTH OFF, LED1OFF & LED2ON, BOTH OFF, etc.


Task 2

Write in C language following example: Two GPIO ports as outputs to diods. Period 1second (intruction cycle takes 1microsedond (1MHz)) - change the lighting diod after 1 sec using TIMER1 and its interrupt. The sequence shoud be: LED1ON & LED2OFF, BOTH OFF, LED1OFF & LED2ON, BOTH OFF, LED1ON & LED2OFF, BOTH OFF, LED1OFF & LED2ON, BOTH OFF, etc.