This document provides instructions for programming a PIC16F877A microcontroller using a PIC ISP software and CCS C compiler. It describes setting up a new project in the CCS compiler, creating and compiling a C code file, and using a PIC ISP software to download the hex file to the microcontroller. It also describes the purpose and positions of two switches on the development board for programming/execution modes and accessing internal/external peripherals. The code sample displays the time from a real-time clock on a 7-segment display and sets an alarm to trigger a buzzer.
This document provides instructions for programming a PIC16F877A microcontroller using a PIC ISP software and CCS C compiler. It describes setting up a new project in the CCS compiler, creating and compiling a C code file, and using a PIC ISP software to download the hex file to the microcontroller. It also describes the purpose and positions of two switches on the development board for programming/execution modes and accessing internal/external peripherals. The code sample displays the time from a real-time clock on a 7-segment display and sets an alarm to trigger a buzzer.
This document provides instructions for programming a PIC16F877A microcontroller using a PIC ISP software and CCS C compiler. It describes setting up a new project in the CCS compiler, creating and compiling a C code file, and using a PIC ISP software to download the hex file to the microcontroller. It also describes the purpose and positions of two switches on the development board for programming/execution modes and accessing internal/external peripherals. The code sample displays the time from a real-time clock on a 7-segment display and sets an alarm to trigger a buzzer.
Go to project then next Select PIC16F877A Select CCS compiler for PIC in active toolsuite Pick CCS compiler exe(Ccsc) in location by browsing D:\Program Files\PICC\Ccsc.exe Create a new project in a new folder by browsing through location. Save the project with a file name in that folder like D:\Program Files\PICC\test\test Go to next and next and finish. Go to file and create new. Type the program and save it with file name extension .c like RTC.c Add that c file in source file. Go to project. Compile. if the program is right, then it is build succeeded and hex file is generated with the same file name of the c file. Open PIC ISP software. Select the generated hex file by browsing. Keep the switches appropriately with power ON and serial cabled with PC. (Switch SW6 should be in upward direction. (i.e) programming mode. Switch SW7 should be upward for on-board experiments like buzzer, RTC. Switch SW7 should be downward for external peripheral interfacing experiments like Model train.) Download the program, and after successful downloading Switch SW6 should be changed to downward direction. (i.e) execution mode. And reset should be pressed.)
During program downloading Switch SW6 should be in upward direction. (i.e) programming mode.
During program execution Switch SW6 should be in downward direction. (i.e) execution mode. And reset should be pressed.
Switch SW7 should be upward for on-board experiments like buzzer, RTC.
Switch SW7 should be downward for external peripheral interfacing experiments like Model train.
In VPUT-01 Universal PIC Embedded trainer, Two switches are provided. One switch is for programming and Execuation(PIC ,dsPIC and 89C51 microcontrollers). If the Switch is in Porg. mode, CPU goes to Boot mode.In boot mode we can download the Hex files through windows serial downloader(e.g PIC ISP,Win ISP). If Switch is in Exec mode CPU goes to Execuation mode.User code going to be executed. Another one switch for selection of Internal and external peripherals. If the switch is in Internal mode,we can access the onboard peripherals. It the switch is in the External mode we can access the add-on cards without distrubing the onboard peripherals. Real Time clock
//This Program for Serial Real time Clock //display clock time in 7-segment display //set alarm time and buzzer on alarm time for 5 sec //SCL - RC3 //SDA - RC4 //DEVICE ADDRESS - 0XA0 - 0XA1
#include <16F877.H> #use delay(clock=20000000) #use rs232(baud=19200, xmit=PIN_C6, rcv=PIN_C7) #use I2C(MASTER,sda=PIN_C4,scl=PIN_C3) unsigned int time[]={0x05,0x57}; //(seconds,minute) unsigned int readtime[0x02]; unsigned long int second,second1,minute,minute1; unsigned int a,b,a1,b1,c1,d1,dat; int i,j;