Docsity

Introduction to Timers and Counters Programming in PIC18F Microcontrollers, Assignments of Earth science

Toggle sidebar
bg1
PIC18F
TIMER,COUNTER
PROGRAMMING
OBJECTIVE:
• Introduction to Timers in PIC18
• Familiarization with programming of Timers in Assembly and C18 language
• Understanding different timers Modes and its use in Microcontrollers. • Familiarization with
Programming Counters in Assembly and C18 language
Lab Task # 1
Code:
#include <p18f452.h>
void Delay(void);
void main(void)
{
TRISAbits.TRISA4 = 0;
TRISCbits.TRISC0 = 1;
PORTC = 255;
while(1)
{
if (PORTCbits.RC0 == 1)
{
PORTAbits.RA4=1;
Delay();
PORTAbits.RA4=0;
pf3

Partial preview of the text

Download Introduction to Timers and Counters Programming in PIC18F Microcontrollers and more Assignments Earth science in PDF only on Docsity!

PIC18F

TIMER,COUNTER

PROGRAMMING

OBJECTIVE:

  • Introduction to Timers in PIC
  • Familiarization with programming of Timers in Assembly and C18 language
  • Understanding different timers Modes and its use in Microcontrollers. • Familiarization with Programming Counters in Assembly and C18 language Lab Task # 1 Code: #include <p18f452.h> void Delay(void); void main(void) { TRISAbits.TRISA4 = 0; TRISCbits.TRISC0 = 1; PORTC = 255; while(1) { if (PORTCbits.RC0 == 1) { PORTAbits.RA4=1; Delay(); PORTAbits.RA4=0;

Delay(); Delay(); Delay(); } else { PORTAbits.RA4=1; Delay();