Tutorials

Shift left – shift right value For CSS Compiler

#include <16F877.h> #device adc=8 #FUSES NOWDT ,XT #use delay(clock=4000000) int8 x,k; void main() { setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); 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_tris_b(0x00); output_b(0); k=0; x=0x01; while(true) { for(k=0;k<=7;++k){ output_b (x); delay_ms(150); shift_left(&x,1,0); } x = 0x80; k = 0; for(k=0;k<=7;++k){ output_b (x); delay_ms(150); shift_right(&x,1,0); } x = 0x01; k = 0; } }

Shift left – shift right value For CSS Compiler Read More »

PIC Microcontroller Unit PIC16F877A

PIC Microcontroller Unit(PIC16F877A)

A Project entitled “PIC Microcontroller Unit” presented by Quezon City Polytechnic University (QCPU), Fourth year students of Bachelor of Science in Information Technology (BSIT), Major in Computer Technology. For the elecytive subject of “MIcroprocessor”. Submitted by Group number two(2) and to be submitted to Professor Ambito. For School Year 2012-2013, Second Semester. Group Members: Graellos

PIC Microcontroller Unit(PIC16F877A) Read More »

PIC Microcontroller Video Tutorial Series

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, extensive collection of application notes, availability of low cost

PIC Microcontroller Video Tutorial Series Read More »

Light Detection

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 SetUpDelay Delay1 DelayA Look Look1 Look2 Main Main1 Main2 Main3 ORG 00

Whistle-On Whistle-Off 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); Lcd_init(); while(true){ set_adc_channel(0); delay_ms(10); value = read_adc(); // 0-1023 Lcd_row_col(1,0); Lcd_putc(“setpoint=”); hex_bcd(value);lcd_row_col(1,9);sent_Lcd(); delay_ms(50); } }

Analog to digital 8 bits For CSS Compiler 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_ms(20); lcd_row_col(3,0); lcd_putc(“www.kchimicro “); delay_ms(20); lcd_row_col(4,0); lcd_putc(“Pic controller “); delay_ms(5000); lcd_Clear(); lcd_init(); while(true){ value1 = 2568; value2 = 1278; value3 = 8887;

LCD Module Display 4 line For CSS Compiler 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_Cls(); while(true){ value = 2568; value1 = 1278; //================================== lcd_row_col(1,0); Lcd_putc(“setpoint=”); hex_bcd(value);lcd_row_col(1,9);sent_Lcd(); //delay_ms(100); //================================== lcd_row_col(2,0); Lcd_putc(“Value=”); hex_bcd(value1);lcd_row_col(2,6);sent_Lcd(); delay_ms(100); } }  

LCD Module Display 2 line For CSS Compiler Read More »