PIC Microcontroller Video Tutorial Series

PIC is a family of modified Harvard architecture microcontrollers made by Microchip Technology, derived from the PIC1650[1][2][3] originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to "Peripheral Interface Controller".[4][5] PICs are popular with both industrial developers and hobbyists alike due to their low cost, wide availability, large user base, exte ...

Read more

Whistle-On Whistle-Off

This experiment turns on a LED when a whistle is detected. The LED turns off when the whistle is detected for the second time.                       ;Expt11b.asm ;Project: Whistle-On  Whistle-Off List P = 16F84 #include <p16F84.inc> __CONFIG 1Bh    ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC SetUp Delay Delay1 DelayA Look Look1 Look2 Main Main1 Main2 Main3 ORG 00 BSF 03,5 CLRF 06 MOVLW 02 MO ...

Read more

Turning on a LED using PIC16F84

This experiment turns on a LED when button A is pressed. The button is connected to the lowest bit of Port A (bit0). When the button is pressed, the line goes HIGH. This is called positive logic. The LED is connected to the lowest bit of Port B (Bit0). Any bit of any port can be an input or output. It is convenient to make port "A" an input and port "B" an output. Port A has 5 lines and port B has 8 lines. ...

Read more

Analog to digital 8 bits For CSS Compiler

  #include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) #include <Lcd_4bit.c> int8 value; void main() { setup_adc_ports(AN0_AN1_AN3); setup_adc(ADC_CLOCK_DIV_2); setup_psp(PSP_DISABLED); setup_spi(SPI_SS_DISABLED); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); set_adc_channel(0); set_tris_d(0x00); set_tris_A(0xff) ...

Read more

LCD Module Display 4 line For CSS Compiler

#include <16F877.h> #device adc=8 #fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG #use delay(clock=4000000) #include <Lcd_4bit.c> int16 value1,value2,value3,value4; void main(){ setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); set_tris_d(0x00); lcd_init(); lcd_row_col(1,0); lcd_putc("Electrical Power"); delay_ms(20); lcd_row_col(2,0); lcd_putc("Loei Technical "); delay_ ...

Read more

LCD Module Display 2 line For CSS Compiler

#include <16F877.h> #device adc=8 #fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG #use delay(clock=4000000) #include <Lcd_4bit.c> int16 value,value1; void main(){ setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); set_tris_d(0x00); lcd_init(); lcd_row_col(1,0); lcd_putc("Electrical Power"); delay_ms(20); lcd_row_col(2,0); lcd_putc("Loei Technical "); delay_ms(5000); lcd_C ...

Read more

Seven segment display 4 digit for shift 595 For CSS Compiler

#include <16F877.h> #device adc=8 #fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG #use delay(clock=4000000) #include "shift_595.c" void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_psp(PSP_DISABLED); setup_spi(FALSE); setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); set_tris_b(0x00); while(true){ if(SETPOI ...

Read more

Seven segment _2digit_anode For CSS Compiler

#include <16F877.h> #device adc=8 #fuses NOWDT,HS, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG #use delay(clock=4000000) #define sw_up pin_a0 // SWITCH UP #define sw_down pin_a1 // SWITCH DOWN INT8 COUNT,A,B; int8 num[10] ={ 0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};//common anode //int8 Segment[10] ={ 0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x27,0x7F,0x6F};//common cathode 0 1 2 3 4 ...

Read more

Wye-delta Motor Controll For CSS Compiler

#include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) #define S1 pin_a0 #define S2 pin_a1 #define S3 pin_a2 #define K1 pin_b0 #define K2 pin_b1 #define K3 pin_b2 void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); set_tris_e(0xff); // input set_tris_b(0x00); // output output_b(0x00); // initial output = 0; while(true) { if(!input(S1)) { output_high(K1); output_high(K2 ...

Read more

Sound frequency For CSS Compiler

#include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) void sound (char freq,int16 time) // Sound Generate { unsigned char i; while (time>0) { output_low (pin_b0); for (i=1;i<=freq;i++) time--; output_high (pin_b0); for (i=1;i<=freq;i++) time--; } } void main(){ set_tris_a(0xff); set_tris_b(0x00); setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); output_b(0x00); while(tru ...

Read more
Scroll to top