Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018

194 views

Published on

Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018

Published in: Education
  • Be the first to comment

  • Be the first to like this

Pic programms FOR 8TH SEM STUDENTS BY LOHITH KUMAR | 11GUEE6018

  1. 1.  Implementthe 8 bit UP / Down Counter using PIC Microcontroller  UP Counter #include<p24fj128ga010.h> void Delay(); unsigned int j; unsigned int k; void main () { unsigned int i; TRISA=0x0000; while(1) { for(i=0;i<=255;i++) { PORTA=i; Delay(); } } } void Delay() { for (j=0;j<9000;j++) for (k=0;k<100;k++); }  Down Counter #include<p24fj128ga010.h> void Delay(); unsigned int j; unsigned int k; void main () { unsigned int i; TRISA=0x0000; while(1) { for(i=255;i>=0;i--) { PORTA=i; Delay(); } } } void Delay() { for (j=0;j<9000;j++) for (k=0;k<100;k++); }
  2. 2.  Demonstrate Right and Left Shift operation using PIC Microcontroller  RightOperation #include<p24fj128ga010.h> void Delay(); unsigned int j; unsigned int k; void main () { unsigned int i,b; TRISA=0x0000; while(1) { b=128; for(i=0;i<=7;i++) { PORTA=b; Delay(); b=b>>1; } } } void Delay() { for (j=0;j<9000;j++) for (k=0;k<100;k++); }  Left Shift Opetation #include<p24fj128ga010.h> void Delay(); unsigned int j; unsigned int k; void main () { unsigned int i,b; TRISA=0x0000; while(1) { b=1; for(i=0;i<=7;i++) { PORTA=b; Delay(); b=b<<1; } } } void Delay() { for (j=0;j<9000;j++) for (k=0;k<100;k++); }

×