Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

TUTORIAL #1

Write a C program using CCS C compiler which does the following:



a. Get input from pin C0 of PIC16F877A, then increase counter
b. Then display the binary output of the counter using portb.
c. Simulate your program using Proteus.



TUTORIAL #2
From the given program code in C, edit the program to display moving character on the LCD. First
row shows welcome. Second row will display running characters showing This is the place where a
career begins. Simulate your program in Proteus. Use your creativity to spice it up and make it
fancier.
Tips: using for loops to display incremental string.

//display string using 2x16 LCD
//use lcd_gotoxy(col,row)
#include "f:\PIC_Course\PIC_chapter7_ADC\headerfiles.h"

# define use_portb_lcd true
#include <lcd.c>

void main()
{
lcd_init();
do
{
lcd_gotoxy(5,1);
lcd_putc("welcome ");
lcd_putc("\n to UTEM");
delay_ms(1000);
lcd_putc("\f");
}while(1);
}





TUTORIAL #3
Write a program to get analog voltage input from a variable resistor & display it on LCD. The voltage
level is between 0 to 5V with incremental of 1 V. Simulate your program in Proteus. You may use the
following analog input instruction setting in your program:
setup_adc_ports(all_analog);
setup_adc(adc_clock_internal);
set_adc_channel(0);

You might also like